Documentation ¶
Index ¶
- Constants
- type Client
- func (this *Client) ListenToDeviceCommands(deviceId string, commandHandler DeviceCommandHandler) error
- func (this *Client) MarshalAndSendEvent(deviceId string, serviceId string, value interface{}) error
- func (this *Client) NotifyDeviceManagerRefresh(f func())
- func (this *Client) RemoveDevice(deviceId string) error
- func (this *Client) Respond(deviceId string, serviceId string, response Command) error
- func (this *Client) SendClientError(message string)
- func (this *Client) SendCommandError(correlationId string, message string)
- func (this *Client) SendDeviceError(localDeviceId string, message string)
- func (this *Client) SendDeviceUpdate(info DeviceInfoUpdate) error
- func (this *Client) SendEvent(deviceId string, serviceId string, msg []byte) error
- func (this *Client) SetDevice(deviceId string, info DeviceInfo) error
- func (this *Client) StopListenToDeviceCommands(deviceId string) error
- type Command
- type DeviceCommandHandler
- type DeviceInfo
- type DeviceInfoUpdate
- type State
- type Subscription
Constants ¶
View Source
const DeviceManagerTopic = "device-manager/device"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ListenToDeviceCommands ¶
func (this *Client) ListenToDeviceCommands(deviceId string, commandHandler DeviceCommandHandler) error
func (*Client) MarshalAndSendEvent ¶
func (*Client) NotifyDeviceManagerRefresh ¶
func (this *Client) NotifyDeviceManagerRefresh(f func())
func (*Client) RemoveDevice ¶
func (*Client) SendClientError ¶
func (*Client) SendCommandError ¶
func (*Client) SendDeviceError ¶
func (*Client) SendDeviceUpdate ¶
func (this *Client) SendDeviceUpdate(info DeviceInfoUpdate) error
func (*Client) StopListenToDeviceCommands ¶
type Command ¶
{"command_id": "senergy-connector-client-connector-b8b6f84c-6be2-4b87-aca2-a4696bf069ae", "data": ""}
type DeviceCommandHandler ¶
type DeviceInfo ¶
type DeviceInfo struct { Name string `json:"name"` State State `json:"state"` DeviceType string `json:"device_type"` }
{"name": "airSensor", "state": "online", "device_type": "urn:infai:ses:device-type:a8cbd322-9d8c-4f4c-afec-ae4b7986b6ed"}
type DeviceInfoUpdate ¶
type DeviceInfoUpdate struct { Method string `json:"method"` DeviceId string `json:"device_id"` Data DeviceInfo `json:"data"` }
{"method": "set", "device_id": "x2gHd2fwdxjUR_lmee3bLw-5ecf7fb0bf6d", "data": {"name": "airSensor", "state": "online", "device_type": "urn:infai:ses:device-type:a8cbd322-9d8c-4f4c-afec-ae4b7986b6ed"}}
type Subscription ¶
type Subscription struct { Topic string Handler paho.MessageHandler }
Click to show internal directories.
Click to hide internal directories.