Versions in this module Expand all Collapse all v0 v0.1.0 Aug 1, 2024 Changes in this version + const ReceiveTopicFormat + const SendDevicesTopic + var DeviceNo = "" + var DevicePannelAddress = "" + var MQTTClient mqtt.Client + var MQTTClientID = fmt.Sprintf("controller-%d", time.Now().UnixMilli()) + var MQTTPassword = "" + var MQTTSecretEnable = false + var MQTTSecretKey = "" + var MQTTServer = "localhost:1883" + var MQTTUser = "" + var ReceiveTopic = "" + func Decrypt(cipherText []byte) ([]byte, error) + func Encrypt(plainText []byte) ([]byte, error) + func Init() error + func Publish(cmd Command) error + type Command interface + Msg func() ([]byte, error) + Name func() string + type CommandResult struct + Command string + DeviceNo string + Result string + Serial string + type Device map[string]string + func DeviceStatus(channel string) (Device, bool) + type Panel struct + Address string + ChildDev []Device + type ReadStatusCommand struct + Command string + Serial string + Timestamp string + func NewReadStatusCommand() *ReadStatusCommand + func (c *ReadStatusCommand) Msg() ([]byte, error) + func (c *ReadStatusCommand) Name() string + type ReadStatusResult struct + Command string + DeviceNo string + Panels []Panel + Serial string + Timestamp string + func NewReadStatusResult(deviceNo string) *ReadStatusResult + func (r *ReadStatusResult) Device(addr string, channel string) (Device, bool) + type SetPanelsCommand struct + Command string + DeviceNo string + Panels []Panel + Serial string + Timestamp string + func NewSetPanelsCommand() *SetPanelsCommand + func NewSetPanelsCommandWithDevice(device Device) *SetPanelsCommand + func (c *SetPanelsCommand) Msg() ([]byte, error) + func (c *SetPanelsCommand) Name() string