mediator

package
v0.0.0-...-a7c7adb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCloudCenter = DefaultCloudMediator.(ICloudCenter)
View Source
var DefaultCloudMediator = newMockCloudMediator()

Functions

This section is empty.

Types

type ICloudCenter

type ICloudCenter interface {
	Register(dev ISmartDevice) //注册设备
}

云中心面向智能设备的注册接口

type ICloudMediator

type ICloudMediator interface {
	Command(id int, cmd string) string
}

云中心面向手机app的接口

type ISmartDevice

type ISmartDevice interface {
	ID() int
	Command(cmd string) string
}

智能设备接口

func NewMockSmartLight

func NewMockSmartLight(id int) ISmartDevice

type MockPhoneApp

type MockPhoneApp struct {
	// contains filtered or unexported fields
}

func NewMockPhoneApp

func NewMockPhoneApp(mediator ICloudMediator) *MockPhoneApp

客户端手机

func (*MockPhoneApp) LightClose

func (me *MockPhoneApp) LightClose(id int) error

func (*MockPhoneApp) LightOpen

func (me *MockPhoneApp) LightOpen(id int) error

func (*MockPhoneApp) LightSwitchMode

func (me *MockPhoneApp) LightSwitchMode(id int, mode int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL