Documentation ¶
Index ¶
- Constants
- func NewSmartbusTCPDriver(serialAddress, brokerAddress string, provideUdpGateway bool) (*wbgo.Driver, error)
- func ParseMessage(reader io.Reader, message interface{}) (err error)
- func ReadChannelStatusField(reader io.Reader, value reflect.Value) error
- func ReadRemarkField(reader io.Reader, value reflect.Value) error
- func ReadSmartbus(reader io.Reader, mutex MutexLike, ch chan *SmartbusMessage, ...)
- func ReadSmartbusFrame(reader io.Reader) ([]byte, bool)
- func ReadSmartbusRaw(reader io.Reader, mutex MutexLike, frameHandler func(frame []byte))
- func ReadStatusBytesField(reader io.Reader, value reflect.Value) error
- func ReadSync(reader io.Reader, mutex MutexLike) error
- func ReadTaggedField(reader io.Reader, value reflect.Value, tag string) error
- func ReadTemperatureListField(reader io.Reader, value reflect.Value) error
- func RegisterDeviceModelType(construct DeviceConstructor)
- func RegisterMessage(messagePtr interface{})
- func WriteChannelStatusField(writer io.Writer, value reflect.Value) error
- func WriteFrame(writer io.Writer, fullMsg SmartbusMessage)
- func WriteFrameRaw(writer io.Writer, header MessageHeader, writeMsg func(writer io.Writer))
- func WriteMessage(writer io.Writer, message interface{}) (err error)
- func WritePreBuiltFrame(writer io.Writer, frame []byte)
- func WriteRemarkField(writer io.Writer, value reflect.Value) error
- func WriteSmartbus(writer io.Writer, mutex MutexLike, ch chan interface{})
- func WriteStatusBytesField(writer io.Writer, value reflect.Value) error
- func WriteTaggedField(writer io.Writer, value reflect.Value, tag string) error
- func WriteTemperatureListField(writer io.Writer, value reflect.Value) error
- type AssignPanelButton
- type AssignPanelButtonResponse
- type Connector
- type DDPDeviceModel
- func (dm *DDPDeviceModel) AcceptOnValue(name, value string) bool
- func (dm *DDPDeviceModel) OnAssignPanelButtonResponse(msg *AssignPanelButtonResponse)
- func (dm *DDPDeviceModel) OnQueryModules(msg *QueryModules)
- func (dm *DDPDeviceModel) OnQueryPanelButtonAssignmentResponse(msg *QueryPanelButtonAssignmentResponse)
- func (dm *DDPDeviceModel) OnReadMACAddressResponse(msg *ReadMACAddressResponse)
- func (dm *DDPDeviceModel) OnSetPanelButtonModesResponse(msg *SetPanelButtonModesResponse)
- func (dm *DDPDeviceModel) OnSingleChannelControlCommand(msg *SingleChannelControlCommand)
- func (dm *DDPDeviceModel) Poll()
- func (dm *DDPDeviceModel) Type() uint16
- type DatagramIO
- type DeviceConstructor
- type DeviceModelBase
- func (dev *DeviceModelBase) AcceptValue(name, value string)
- func (dev *DeviceModelBase) IsVirtual() bool
- func (dm *DeviceModelBase) Name() string
- func (dev *DeviceModelBase) Observe(observer wbgo.DeviceObserver)
- func (dev *DeviceModelBase) OnReadMACAddressResponse(msg *ReadMACAddressResponse)
- func (dm *DeviceModelBase) Title() string
- type FieldReadFunc
- type FieldWriteFunc
- type Hmix12DeviceModel
- type Message
- type MessageDumper
- type MessageFormatter
- func (f *MessageFormatter) OnAssignPanelButton(msg *AssignPanelButton, hdr *MessageHeader)
- func (f *MessageFormatter) OnAssignPanelButtonResponse(msg *AssignPanelButtonResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnPanelControlResponse(msg *PanelControlResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnQueryChannelStatuses(msg *QueryChannelStatuses, hdr *MessageHeader)
- func (f *MessageFormatter) OnQueryChannelStatusesResponse(msg *QueryChannelStatusesResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnQueryModules(msg *QueryModules, hdr *MessageHeader)
- func (f *MessageFormatter) OnQueryModulesResponse(msg *QueryModulesResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnQueryPanelButtonAssignment(msg *QueryPanelButtonAssignment, hdr *MessageHeader)
- func (f *MessageFormatter) OnQueryPanelButtonAssignmentResponse(msg *QueryPanelButtonAssignmentResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnReadMACAddress(msg *ReadMACAddress, hdr *MessageHeader)
- func (f *MessageFormatter) OnReadMACAddressResponse(msg *ReadMACAddressResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnReadSensorStatus(msg *ReadSensorStatus, hdr *MessageHeader)
- func (f *MessageFormatter) OnReadSensorStatusResponse(msg *ReadSensorStatusResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnReadTemperatureValues(msg *ReadTemperatureValues, hdr *MessageHeader)
- func (f *MessageFormatter) OnReadTemperatureValuesResponse(msg *ReadTemperatureValuesResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnSceneControl(msg *SceneControl, hdr *MessageHeader)
- func (f *MessageFormatter) OnSceneControlResponse(msg *SceneControlResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnSensorStatusBroadcast(msg *SensorStatusBroadcast, hdr *MessageHeader)
- func (f *MessageFormatter) OnSetPanelButtonModes(msg *SetPanelButtonModes, hdr *MessageHeader)
- func (f *MessageFormatter) OnSetPanelButtonModesResponse(msg *SetPanelButtonModesResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnSingleChannelControlCommand(msg *SingleChannelControlCommand, hdr *MessageHeader)
- func (f *MessageFormatter) OnSingleChannelControlResponse(msg *SingleChannelControlResponse, hdr *MessageHeader)
- func (f *MessageFormatter) OnZoneBeastBroadcast(msg *ZoneBeastBroadcast, hdr *MessageHeader)
- type MessageHeader
- type MessageQueue
- type MutexLike
- type PacketParser
- type PanelControlResponse
- type PreprocessedMessage
- type QueryChannelStatuses
- type QueryChannelStatusesResponse
- type QueryModules
- type QueryModulesResponse
- type QueryModulesResponseRaw
- type QueryPanelButtonAssignment
- type QueryPanelButtonAssignmentResponse
- type QueueItem
- type QueuePred
- type ReadMACAddress
- type ReadMACAddressResponse
- type ReadSensorStatus
- type ReadSensorStatusResponse
- type ReadTemperatureValues
- type ReadTemperatureValuesResponse
- type RealDeviceModel
- func NewDDPDeviceModel(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
- func NewHmix12DeviceModel(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
- func NewSensor8in1(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
- func NewSensorSB_CMS_8in1(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
- func NewZoneBeastDeviceModel(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
- type Request
- type SceneControl
- type SceneControlResponse
- type Sensor8in1
- type SensorSB_CMS_8in1
- type SensorStatusBroadcast
- type SetPanelButtonModes
- type SetPanelButtonModesResponse
- type SingleChannelControlCommand
- type SingleChannelControlResponse
- type SmartbusConnection
- type SmartbusDevice
- func (dev *SmartbusDevice) AssignPanelButton(buttonNo uint8, functionNo uint8, command uint8, commandSubnetID uint8, ...)
- func (dev *SmartbusDevice) AssignPanelButtonResponse(buttonNo uint8, functionNo uint8)
- func (dev *SmartbusDevice) PanelControlResponse(Type uint8, Value uint8)
- func (dev *SmartbusDevice) QueryChannelStatuses(index uint8)
- func (dev *SmartbusDevice) QueryChannelStatusesResponse(channelStatus []uint8)
- func (dev *SmartbusDevice) QueryModules()
- func (dev *SmartbusDevice) QueryModulesResponse(deviceCategory uint8, channelNo uint8)
- func (dev *SmartbusDevice) QueryPanelButtonAssignment(buttonNo uint8, functionNo uint8)
- func (dev *SmartbusDevice) QueryPanelButtonAssignmentResponse(buttonNo uint8, functionNo uint8, command uint8, commandSubnetID uint8, ...)
- func (dev *SmartbusDevice) ReadMACAddress()
- func (dev *SmartbusDevice) ReadMACAddressResponse(macAddress [8]uint8, remark []uint8)
- func (dev *SmartbusDevice) ReadSensorStatus()
- func (dev *SmartbusDevice) ReadSensorStatusResponse(success bool, temperature int, illumination uint16, ...)
- func (dev *SmartbusDevice) ReadTemperatureValues(useCelsius bool)
- func (dev *SmartbusDevice) ReadTemperatureValuesResponse(useCelsius bool, values []int8)
- func (dev *SmartbusDevice) SceneControl(zoneNo, sceneNo uint8)
- func (dev *SmartbusDevice) SceneControlResponse(zoneNo, sceneNo uint8, channelStatus []bool)
- func (dev *SmartbusDevice) Send(msg Message)
- func (dev *SmartbusDevice) SensorStatusBroadcast(temperature int, illumination uint16, movement, dryContact1, dryContact2 bool)
- func (dev *SmartbusDevice) SetPanelButtonModes(modes [PANEL_BUTTON_COUNT]string)
- func (dev *SmartbusDevice) SetPanelButtonModesResponse(success bool)
- func (dev *SmartbusDevice) SingleChannelControl(channelNo uint8, level uint8, duration uint16)
- func (dev *SmartbusDevice) SingleChannelControlResponse(channelNo uint8, success bool, level uint8, status []bool)
- func (dev *SmartbusDevice) ZoneBeastBroadcast(zoneStatus []uint8, channelStatus []bool)
- type SmartbusEndpoint
- func (ep *SmartbusEndpoint) AddInputSniffer(observer interface{})
- func (ep *SmartbusEndpoint) AddOutputSniffer(observer interface{})
- func (ep *SmartbusEndpoint) GetBroadcastDevice() *SmartbusDevice
- func (ep *SmartbusEndpoint) GetSmartbusDevice(subnetID uint8, deviceID uint8) *SmartbusDevice
- func (ep *SmartbusEndpoint) Observe(observer interface{})
- func (ep *SmartbusEndpoint) Send(msg SmartbusMessage)
- type SmartbusIO
- type SmartbusMessage
- type SmartbusModel
- func (model *SmartbusModel) OnAnything(msg Message, header *MessageHeader)
- func (model *SmartbusModel) Poll()
- func (model *SmartbusModel) SetTimerFunc(timerFunc TimerFunc)
- func (model *SmartbusModel) SetVirtualRelayOn(channelNo int, on bool)
- func (model *SmartbusModel) Start() error
- func (model *SmartbusModel) Stop()
- func (model *SmartbusModel) VirtualRelayStatus() []bool
- type SmartbusStreamIO
- type TimeoutChecker
- type TimerFunc
- type VirtualRelayDevice
- func (dm *VirtualRelayDevice) AcceptOnValue(name, value string) bool
- func (dm *VirtualRelayDevice) AcceptValue(name, value string)
- func (dm *VirtualRelayDevice) IsVirtual() bool
- func (dm *VirtualRelayDevice) Publish()
- func (dm *VirtualRelayDevice) RelayStatus() []bool
- func (dm *VirtualRelayDevice) SetRelayOn(channelNo int, on bool)
- type ZoneBeastBroadcast
- type ZoneBeastDeviceModel
- func (dm *ZoneBeastDeviceModel) AcceptOnValue(name, value string) bool
- func (dm *ZoneBeastDeviceModel) OnReadTemperatureValuesResponse(msg *ReadTemperatureValuesResponse)
- func (dm *ZoneBeastDeviceModel) OnSingleChannelControlResponse(msg *SingleChannelControlResponse)
- func (dm *ZoneBeastDeviceModel) OnZoneBeastBroadcast(msg *ZoneBeastBroadcast)
- func (dm *ZoneBeastDeviceModel) Poll()
- func (dm *ZoneBeastDeviceModel) Type() uint16
Constants ¶
const ( DRIVER_SUBNET = 0x01 DRIVER_DEVICE_ID = 0x99 DRIVER_DEVICE_TYPE = 0x1234 DRIVER_CLIENT_ID = "smartbus" )
FIXME
const ( BROADCAST_SUBNET = 0xff BROADCAST_DEVICE = 0xff )
const ( LIGHT_LEVEL_OFF = 0 LIGHT_LEVEL_ON = 100 PANEL_BUTTON_COUNT = 16 )
const ( QUERY_MODULES_DEV_DIMMER = 0x01 QUERY_MODULES_DEV_RELAY = 0x02 QUERY_MODULES_DEV_HVAC = 0x03 QUERY_MODULES_DEV_SENSORS = 0x04 QUERY_MODULES_DEV_Z_AUDIO = 0x05 BUTTON_COMMAND_INVALID = 0x00 BUTTON_COMMAND_SINGLE_CHANNEL_LIGHTING_CONTROL = 0x59 PANEL_CONTROL_TYPE_INVALID = 0x00 PANEL_CONTROL_TYPE_IR_RECEIVER = 0x01 PANEL_CONTROL_TYPE_BUTTON_LOCK = 0x02 PANEL_CONTROL_TYPE_AC_ON_OFF = 0x03 PANEL_CONTROL_TYPE_COOLING_SET_POINT = 0x04 PANEL_CONTROL_TYPE_FAN_SPEED = 0x05 PANEL_CONTROL_TYPE_AC_MODE = 0x06 PANEL_CONTROL_TYPE_HEAT_SET_POINT = 0x07 PANEL_CONTROL_TYPE_AUTO_SET_POINT = 0x08 PANEL_CONTROL_TYPE_GO_TO_PAGE = 0x16 )
const ( // FIXME: make these configurable? NUM_VIRTUAL_RELAYS = 15 REQUEST_QUEUE_SIZE = 16 REQUEST_NUM_RETRIES = 20 REQUEST_TIMEOUT = 500 * time.Millisecond )
const (
MESSAGE_QUEUE_INBOUND_QUEUE_SIZE = 10
)
const (
MIN_FRAME_SIZE = 11 // excluding sync
)
const (
SmartbusPort = 6000
)
Variables ¶
This section is empty.
Functions ¶
func NewSmartbusTCPDriver ¶
func ParseMessage ¶
func ReadChannelStatusField ¶
func ReadSmartbus ¶
func ReadSmartbus(reader io.Reader, mutex MutexLike, ch chan *SmartbusMessage, rawReadCh chan []byte)
func ReadSmartbusRaw ¶
func ReadTaggedField ¶
func RegisterDeviceModelType ¶
func RegisterDeviceModelType(construct DeviceConstructor)
func RegisterMessage ¶
func RegisterMessage(messagePtr interface{})
func WriteChannelStatusField ¶
func WriteFrame ¶
func WriteFrame(writer io.Writer, fullMsg SmartbusMessage)
func WriteFrameRaw ¶
func WriteFrameRaw(writer io.Writer, header MessageHeader, writeMsg func(writer io.Writer))
func WriteMessage ¶
func WritePreBuiltFrame ¶
func WriteSmartbus ¶
func WriteStatusBytesField ¶
func WriteTaggedField ¶
Types ¶
type AssignPanelButton ¶
type AssignPanelButton struct { ButtonNo uint8 FunctionNo uint8 Command uint8 CommandSubnetID uint8 CommandDeviceID uint8 ChannelNo uint8 Level uint8 Duration uint16 Unknown uint8 }
func (*AssignPanelButton) Opcode ¶
func (*AssignPanelButton) Opcode() uint16
type AssignPanelButtonResponse ¶
func (*AssignPanelButtonResponse) Opcode ¶
func (*AssignPanelButtonResponse) Opcode() uint16
type Connector ¶
type Connector func() (SmartbusIO, error)
type DDPDeviceModel ¶
type DDPDeviceModel struct { DeviceModelBase // contains filtered or unexported fields }
func (*DDPDeviceModel) AcceptOnValue ¶
func (dm *DDPDeviceModel) AcceptOnValue(name, value string) bool
func (*DDPDeviceModel) OnAssignPanelButtonResponse ¶
func (dm *DDPDeviceModel) OnAssignPanelButtonResponse(msg *AssignPanelButtonResponse)
func (*DDPDeviceModel) OnQueryModules ¶
func (dm *DDPDeviceModel) OnQueryModules(msg *QueryModules)
func (*DDPDeviceModel) OnQueryPanelButtonAssignmentResponse ¶
func (dm *DDPDeviceModel) OnQueryPanelButtonAssignmentResponse(msg *QueryPanelButtonAssignmentResponse)
func (*DDPDeviceModel) OnReadMACAddressResponse ¶
func (dm *DDPDeviceModel) OnReadMACAddressResponse(msg *ReadMACAddressResponse)
func (*DDPDeviceModel) OnSetPanelButtonModesResponse ¶
func (dm *DDPDeviceModel) OnSetPanelButtonModesResponse(msg *SetPanelButtonModesResponse)
func (*DDPDeviceModel) OnSingleChannelControlCommand ¶
func (dm *DDPDeviceModel) OnSingleChannelControlCommand(msg *SingleChannelControlCommand)
func (*DDPDeviceModel) Poll ¶
func (dm *DDPDeviceModel) Poll()
func (*DDPDeviceModel) Type ¶
func (dm *DDPDeviceModel) Type() uint16
type DatagramIO ¶
type DatagramIO struct {
// contains filtered or unexported fields
}
func NewDatagramIO ¶
func NewDatagramIO(rawReadCh chan []byte) (*DatagramIO, error)
func (*DatagramIO) Send ¶
func (dgramIO *DatagramIO) Send(msg SmartbusMessage)
func (*DatagramIO) SendRaw ¶
func (dgramIO *DatagramIO) SendRaw(msg []byte)
func (*DatagramIO) Start ¶
func (dgramIO *DatagramIO) Start() chan *SmartbusMessage
func (*DatagramIO) Stop ¶
func (dgramIO *DatagramIO) Stop()
type DeviceConstructor ¶
type DeviceConstructor func(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
type DeviceModelBase ¶
type DeviceModelBase struct { Observer wbgo.DeviceObserver // contains filtered or unexported fields }
func (*DeviceModelBase) AcceptValue ¶
func (dev *DeviceModelBase) AcceptValue(name, value string)
func (*DeviceModelBase) IsVirtual ¶
func (dev *DeviceModelBase) IsVirtual() bool
func (*DeviceModelBase) Name ¶
func (dm *DeviceModelBase) Name() string
func (*DeviceModelBase) Observe ¶
func (dev *DeviceModelBase) Observe(observer wbgo.DeviceObserver)
func (*DeviceModelBase) OnReadMACAddressResponse ¶
func (dev *DeviceModelBase) OnReadMACAddressResponse(msg *ReadMACAddressResponse)
func (*DeviceModelBase) Title ¶
func (dm *DeviceModelBase) Title() string
type Hmix12DeviceModel ¶
type Hmix12DeviceModel struct {
*ZoneBeastDeviceModel
}
TBD: test
func (*Hmix12DeviceModel) OnQueryChannelStatusesResponse ¶
func (hm *Hmix12DeviceModel) OnQueryChannelStatusesResponse(msg *QueryChannelStatusesResponse)
func (*Hmix12DeviceModel) Poll ¶
func (hm *Hmix12DeviceModel) Poll()
func (*Hmix12DeviceModel) Type ¶
func (hm *Hmix12DeviceModel) Type() uint16
type MessageDumper ¶
type MessageDumper struct {
MessageFormatter
}
func NewMessageDumper ¶
func NewMessageDumper(prefix string) *MessageDumper
type MessageFormatter ¶
type MessageFormatter struct {
AddMessage func(format string, args ...interface{})
}
func (*MessageFormatter) OnAssignPanelButton ¶
func (f *MessageFormatter) OnAssignPanelButton(msg *AssignPanelButton, hdr *MessageHeader)
func (*MessageFormatter) OnAssignPanelButtonResponse ¶
func (f *MessageFormatter) OnAssignPanelButtonResponse(msg *AssignPanelButtonResponse, hdr *MessageHeader)
func (*MessageFormatter) OnPanelControlResponse ¶
func (f *MessageFormatter) OnPanelControlResponse(msg *PanelControlResponse, hdr *MessageHeader)
func (*MessageFormatter) OnQueryChannelStatuses ¶
func (f *MessageFormatter) OnQueryChannelStatuses(msg *QueryChannelStatuses, hdr *MessageHeader)
func (*MessageFormatter) OnQueryChannelStatusesResponse ¶
func (f *MessageFormatter) OnQueryChannelStatusesResponse(msg *QueryChannelStatusesResponse, hdr *MessageHeader)
func (*MessageFormatter) OnQueryModules ¶
func (f *MessageFormatter) OnQueryModules(msg *QueryModules, hdr *MessageHeader)
func (*MessageFormatter) OnQueryModulesResponse ¶
func (f *MessageFormatter) OnQueryModulesResponse(msg *QueryModulesResponse, hdr *MessageHeader)
func (*MessageFormatter) OnQueryPanelButtonAssignment ¶
func (f *MessageFormatter) OnQueryPanelButtonAssignment(msg *QueryPanelButtonAssignment, hdr *MessageHeader)
func (*MessageFormatter) OnQueryPanelButtonAssignmentResponse ¶
func (f *MessageFormatter) OnQueryPanelButtonAssignmentResponse(msg *QueryPanelButtonAssignmentResponse, hdr *MessageHeader)
func (*MessageFormatter) OnReadMACAddress ¶
func (f *MessageFormatter) OnReadMACAddress(msg *ReadMACAddress, hdr *MessageHeader)
func (*MessageFormatter) OnReadMACAddressResponse ¶
func (f *MessageFormatter) OnReadMACAddressResponse(msg *ReadMACAddressResponse, hdr *MessageHeader)
func (*MessageFormatter) OnReadSensorStatus ¶
func (f *MessageFormatter) OnReadSensorStatus(msg *ReadSensorStatus, hdr *MessageHeader)
func (*MessageFormatter) OnReadSensorStatusResponse ¶
func (f *MessageFormatter) OnReadSensorStatusResponse(msg *ReadSensorStatusResponse, hdr *MessageHeader)
func (*MessageFormatter) OnReadTemperatureValues ¶
func (f *MessageFormatter) OnReadTemperatureValues(msg *ReadTemperatureValues, hdr *MessageHeader)
func (*MessageFormatter) OnReadTemperatureValuesResponse ¶
func (f *MessageFormatter) OnReadTemperatureValuesResponse(msg *ReadTemperatureValuesResponse, hdr *MessageHeader)
func (*MessageFormatter) OnSceneControl ¶
func (f *MessageFormatter) OnSceneControl(msg *SceneControl, hdr *MessageHeader)
func (*MessageFormatter) OnSceneControlResponse ¶
func (f *MessageFormatter) OnSceneControlResponse(msg *SceneControlResponse, hdr *MessageHeader)
func (*MessageFormatter) OnSensorStatusBroadcast ¶
func (f *MessageFormatter) OnSensorStatusBroadcast(msg *SensorStatusBroadcast, hdr *MessageHeader)
func (*MessageFormatter) OnSetPanelButtonModes ¶
func (f *MessageFormatter) OnSetPanelButtonModes(msg *SetPanelButtonModes, hdr *MessageHeader)
func (*MessageFormatter) OnSetPanelButtonModesResponse ¶
func (f *MessageFormatter) OnSetPanelButtonModesResponse(msg *SetPanelButtonModesResponse, hdr *MessageHeader)
func (*MessageFormatter) OnSingleChannelControlCommand ¶
func (f *MessageFormatter) OnSingleChannelControlCommand(msg *SingleChannelControlCommand, hdr *MessageHeader)
func (*MessageFormatter) OnSingleChannelControlResponse ¶
func (f *MessageFormatter) OnSingleChannelControlResponse(msg *SingleChannelControlResponse, hdr *MessageHeader)
func (*MessageFormatter) OnZoneBeastBroadcast ¶
func (f *MessageFormatter) OnZoneBeastBroadcast(msg *ZoneBeastBroadcast, hdr *MessageHeader)
type MessageHeader ¶
type MessageQueue ¶
func NewMessageQueue ¶
func (*MessageQueue) Enqueue ¶
func (queue *MessageQueue) Enqueue(item QueueItem) error
Enqueue puts item into the queue. If the queue is full, an error is returned. This function is threadsafe.
func (*MessageQueue) HandleReceivedMessage ¶
func (queue *MessageQueue) HandleReceivedMessage(msg Message)
HandleReceivedMessage notifies the queue about the incoming message. This function is threadsafe.
func (*MessageQueue) Start ¶
func (queue *MessageQueue) Start()
func (*MessageQueue) Stop ¶
func (queue *MessageQueue) Stop()
type PacketParser ¶
func MakePreprocessedPacketParser ¶
func MakePreprocessedPacketParser(construct func() Message) PacketParser
func MakeSimplePacketParser ¶
func MakeSimplePacketParser(construct func() Message) PacketParser
type PanelControlResponse ¶
PanelControlResponse is sent by the panel (should be sent as a response to similiarly structured 0xe3d8, but seems to be sent on its own, too)
func (*PanelControlResponse) Opcode ¶
func (*PanelControlResponse) Opcode() uint16
type PreprocessedMessage ¶
type QueryChannelStatuses ¶
type QueryChannelStatuses struct {
Index uint8 // spec says there's no such field, but it's present
}
QueryChannelStatuses is sent by the panel to fan controller devices
func (*QueryChannelStatuses) Opcode ¶
func (*QueryChannelStatuses) Opcode() uint16
type QueryChannelStatusesResponse ¶
type QueryChannelStatusesResponse struct {
ChannelStatus []uint8 `sbus:"statusBytes"`
}
QueryChannelStatuses is sent by the panel to fan controller devices
func (*QueryChannelStatusesResponse) Opcode ¶
func (*QueryChannelStatusesResponse) Opcode() uint16
type QueryModules ¶
type QueryModules struct{}
QueryModules is sent by DDP upon a button press
func (*QueryModules) Opcode ¶
func (*QueryModules) Opcode() uint16
type QueryModulesResponse ¶
type QueryModulesResponse struct { ControlledDeviceSubnetID uint8 ControlledDeviceID uint8 DeviceCategory uint8 ChannelNo uint8 HVACSubnetID uint8 HVACDeviceID uint8 }
QueryModulesResponse is sent as a response to QueryModules
func (*QueryModulesResponse) FromRaw ¶
func (msg *QueryModulesResponse) FromRaw(parseRaw func(interface{}) error) (err error)
func (*QueryModulesResponse) Opcode ¶
func (*QueryModulesResponse) Opcode() uint16
func (*QueryModulesResponse) ToRaw ¶
func (msg *QueryModulesResponse) ToRaw() (interface{}, error)
type QueryModulesResponseRaw ¶
type QueryPanelButtonAssignment ¶
func (*QueryPanelButtonAssignment) Opcode ¶
func (*QueryPanelButtonAssignment) Opcode() uint16
type QueryPanelButtonAssignmentResponse ¶
type QueryPanelButtonAssignmentResponse struct { ButtonNo uint8 FunctionNo uint8 Command uint8 CommandSubnetID uint8 CommandDeviceID uint8 ChannelNo uint8 Level uint8 Duration uint16 }
func (*QueryPanelButtonAssignmentResponse) Opcode ¶
func (*QueryPanelButtonAssignmentResponse) Opcode() uint16
type ReadMACAddress ¶
type ReadMACAddress struct{}
func (*ReadMACAddress) Opcode ¶
func (*ReadMACAddress) Opcode() uint16
type ReadMACAddressResponse ¶
func (*ReadMACAddressResponse) Opcode ¶
func (*ReadMACAddressResponse) Opcode() uint16
type ReadSensorStatus ¶
type ReadSensorStatus struct{}
func (*ReadSensorStatus) Opcode ¶
func (*ReadSensorStatus) Opcode() uint16
type ReadSensorStatusResponse ¶
type ReadSensorStatusResponse struct { Success bool `sbus:"success"` Temperature int `sbus:"sensorTemp"` Illuminance uint16 Movement bool `sbus:"flag"` DryContact1 bool `sbus:"flag"` DryContact2 bool `sbus:"flag"` Reserved1 uint8 Reserved2 uint8 }
func (*ReadSensorStatusResponse) Opcode ¶
func (*ReadSensorStatusResponse) Opcode() uint16
type ReadTemperatureValues ¶
type ReadTemperatureValues struct {
UseCelsius bool `sbus:"flag"`
}
func (*ReadTemperatureValues) Opcode ¶
func (*ReadTemperatureValues) Opcode() uint16
type ReadTemperatureValuesResponse ¶
type ReadTemperatureValuesResponse struct { UseCelsius bool `sbus:"flag"` Values []int8 `sbus:"templist"` }
func (*ReadTemperatureValuesResponse) Opcode ¶
func (*ReadTemperatureValuesResponse) Opcode() uint16
type RealDeviceModel ¶
type RealDeviceModel interface { wbgo.LocalDeviceModel Type() uint16 Poll() }
func NewDDPDeviceModel ¶
func NewDDPDeviceModel(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
func NewHmix12DeviceModel ¶
func NewHmix12DeviceModel(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
func NewSensor8in1 ¶
func NewSensor8in1(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
func NewSensorSB_CMS_8in1 ¶
func NewSensorSB_CMS_8in1(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
func NewZoneBeastDeviceModel ¶
func NewZoneBeastDeviceModel(model *SmartbusModel, smartDev *SmartbusDevice) RealDeviceModel
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) IsResponse ¶
type SceneControl ¶
SceneControl queries device status
func (*SceneControl) Opcode ¶
func (*SceneControl) Opcode() uint16
type SceneControlResponse ¶
type SceneControlResponse struct { ZoneNo uint8 SceneNo uint8 ChannelStatus []bool `sbus:"channelStatus"` }
SceneControlResponse is a response for SceneControl packet
func (*SceneControlResponse) Opcode ¶
func (*SceneControlResponse) Opcode() uint16
type Sensor8in1 ¶
type Sensor8in1 struct { DeviceModelBase // contains filtered or unexported fields }
func (*Sensor8in1) AcceptOnValue ¶
func (sens *Sensor8in1) AcceptOnValue(name, value string) bool
func (*Sensor8in1) OnReadSensorStatusResponse ¶
func (sens *Sensor8in1) OnReadSensorStatusResponse(msg *ReadSensorStatusResponse)
func (*Sensor8in1) Poll ¶
func (sens *Sensor8in1) Poll()
func (*Sensor8in1) Type ¶
func (sens *Sensor8in1) Type() uint16
type SensorSB_CMS_8in1 ¶
type SensorSB_CMS_8in1 struct { Sensor8in1 // contains filtered or unexported fields }
func (*SensorSB_CMS_8in1) Type ¶
func (sens *SensorSB_CMS_8in1) Type() uint16
type SensorStatusBroadcast ¶
type SensorStatusBroadcast struct { Temperature int `sbus:"sensorTemp"` Illuminance uint16 Movement bool `sbus:"flag"` DryContact1 bool `sbus:"flag"` DryContact2 bool `sbus:"flag"` Reserved1 uint8 Reserved2 uint8 }
func (*SensorStatusBroadcast) Opcode ¶
func (*SensorStatusBroadcast) Opcode() uint16
type SetPanelButtonModes ¶
type SetPanelButtonModes struct {
Modes [16]string `sbus:"panelButtonModes"`
}
func (*SetPanelButtonModes) Opcode ¶
func (*SetPanelButtonModes) Opcode() uint16
type SetPanelButtonModesResponse ¶
type SetPanelButtonModesResponse struct {
Success bool `sbus:"success"`
}
func (*SetPanelButtonModesResponse) Opcode ¶
func (*SetPanelButtonModesResponse) Opcode() uint16
type SingleChannelControlCommand ¶
type SingleChannelControlCommand struct { ChannelNo uint8 Level uint8 Duration uint16 // FIXME: is it really duration? ("running time") }
SingleChannelControlCommand toggles single relay output
func (*SingleChannelControlCommand) Opcode ¶
func (*SingleChannelControlCommand) Opcode() uint16
type SingleChannelControlResponse ¶
type SingleChannelControlResponse struct { ChannelNo uint8 Success bool `sbus:"success"` Level uint8 ChannelStatus []bool `sbus:"channelStatus"` }
SingleChannelControlResponse is sent as a response to SingleChannelControlCommand
func (*SingleChannelControlResponse) Opcode ¶
func (*SingleChannelControlResponse) Opcode() uint16
type SmartbusConnection ¶
type SmartbusConnection struct {
// contains filtered or unexported fields
}
SmartbusConnection provides higher-level interface for a SmartbusIO that uses endpoints to filter incoming messages by their destination and assign source addresses to outgoind messages.
func NewSmartbusConnection ¶
func NewSmartbusConnection(smartbusIO SmartbusIO) *SmartbusConnection
func (*SmartbusConnection) Close ¶
func (conn *SmartbusConnection) Close()
func (*SmartbusConnection) MakeSmartbusEndpoint ¶
func (conn *SmartbusConnection) MakeSmartbusEndpoint(subnetID uint8, deviceID uint8, deviceType uint16) *SmartbusEndpoint
func (*SmartbusConnection) Send ¶
func (conn *SmartbusConnection) Send(msg SmartbusMessage)
type SmartbusDevice ¶
type SmartbusDevice struct { Endpoint *SmartbusEndpoint SubnetID uint8 DeviceID uint8 DeviceType uint16 // filled in when a packet is received from the device }
func (*SmartbusDevice) AssignPanelButton ¶
func (*SmartbusDevice) AssignPanelButtonResponse ¶
func (dev *SmartbusDevice) AssignPanelButtonResponse(buttonNo uint8, functionNo uint8)
func (*SmartbusDevice) PanelControlResponse ¶
func (dev *SmartbusDevice) PanelControlResponse(Type uint8, Value uint8)
func (*SmartbusDevice) QueryChannelStatuses ¶
func (dev *SmartbusDevice) QueryChannelStatuses(index uint8)
func (*SmartbusDevice) QueryChannelStatusesResponse ¶
func (dev *SmartbusDevice) QueryChannelStatusesResponse(channelStatus []uint8)
func (*SmartbusDevice) QueryModules ¶
func (dev *SmartbusDevice) QueryModules()
func (*SmartbusDevice) QueryModulesResponse ¶
func (dev *SmartbusDevice) QueryModulesResponse(deviceCategory uint8, channelNo uint8)
func (*SmartbusDevice) QueryPanelButtonAssignment ¶
func (dev *SmartbusDevice) QueryPanelButtonAssignment(buttonNo uint8, functionNo uint8)
func (*SmartbusDevice) QueryPanelButtonAssignmentResponse ¶
func (*SmartbusDevice) ReadMACAddress ¶
func (dev *SmartbusDevice) ReadMACAddress()
func (*SmartbusDevice) ReadMACAddressResponse ¶
func (dev *SmartbusDevice) ReadMACAddressResponse(macAddress [8]uint8, remark []uint8)
func (*SmartbusDevice) ReadSensorStatus ¶
func (dev *SmartbusDevice) ReadSensorStatus()
func (*SmartbusDevice) ReadSensorStatusResponse ¶
func (dev *SmartbusDevice) ReadSensorStatusResponse(success bool, temperature int, illumination uint16, movement, dryContact1, dryContact2 bool)
func (*SmartbusDevice) ReadTemperatureValues ¶
func (dev *SmartbusDevice) ReadTemperatureValues(useCelsius bool)
func (*SmartbusDevice) ReadTemperatureValuesResponse ¶
func (dev *SmartbusDevice) ReadTemperatureValuesResponse(useCelsius bool, values []int8)
func (*SmartbusDevice) SceneControl ¶
func (dev *SmartbusDevice) SceneControl(zoneNo, sceneNo uint8)
func (*SmartbusDevice) SceneControlResponse ¶
func (dev *SmartbusDevice) SceneControlResponse(zoneNo, sceneNo uint8, channelStatus []bool)
func (*SmartbusDevice) Send ¶
func (dev *SmartbusDevice) Send(msg Message)
func (*SmartbusDevice) SensorStatusBroadcast ¶
func (dev *SmartbusDevice) SensorStatusBroadcast(temperature int, illumination uint16, movement, dryContact1, dryContact2 bool)
func (*SmartbusDevice) SetPanelButtonModes ¶
func (dev *SmartbusDevice) SetPanelButtonModes(modes [PANEL_BUTTON_COUNT]string)
func (*SmartbusDevice) SetPanelButtonModesResponse ¶
func (dev *SmartbusDevice) SetPanelButtonModesResponse(success bool)
func (*SmartbusDevice) SingleChannelControl ¶
func (dev *SmartbusDevice) SingleChannelControl(channelNo uint8, level uint8, duration uint16)
func (*SmartbusDevice) SingleChannelControlResponse ¶
func (dev *SmartbusDevice) SingleChannelControlResponse(channelNo uint8, success bool, level uint8, status []bool)
func (*SmartbusDevice) ZoneBeastBroadcast ¶
func (dev *SmartbusDevice) ZoneBeastBroadcast(zoneStatus []uint8, channelStatus []bool)
type SmartbusEndpoint ¶
type SmartbusEndpoint struct { Connection *SmartbusConnection SubnetID uint8 DeviceID uint8 DeviceType uint16 // contains filtered or unexported fields }
func (*SmartbusEndpoint) AddInputSniffer ¶
func (ep *SmartbusEndpoint) AddInputSniffer(observer interface{})
func (*SmartbusEndpoint) AddOutputSniffer ¶
func (ep *SmartbusEndpoint) AddOutputSniffer(observer interface{})
func (*SmartbusEndpoint) GetBroadcastDevice ¶
func (ep *SmartbusEndpoint) GetBroadcastDevice() *SmartbusDevice
func (*SmartbusEndpoint) GetSmartbusDevice ¶
func (ep *SmartbusEndpoint) GetSmartbusDevice(subnetID uint8, deviceID uint8) *SmartbusDevice
func (*SmartbusEndpoint) Observe ¶
func (ep *SmartbusEndpoint) Observe(observer interface{})
func (*SmartbusEndpoint) Send ¶
func (ep *SmartbusEndpoint) Send(msg SmartbusMessage)
type SmartbusIO ¶
type SmartbusIO interface { Start() chan *SmartbusMessage Send(msg SmartbusMessage) Stop() }
type SmartbusMessage ¶
type SmartbusMessage struct { Header MessageHeader Message interface{} }
func ParseFrame ¶
func ParseFrame(frame []byte) (*SmartbusMessage, error)
type SmartbusModel ¶
func NewSmartbusModel ¶
func (*SmartbusModel) OnAnything ¶
func (model *SmartbusModel) OnAnything(msg Message, header *MessageHeader)
func (*SmartbusModel) Poll ¶
func (model *SmartbusModel) Poll()
func (*SmartbusModel) SetTimerFunc ¶
func (model *SmartbusModel) SetTimerFunc(timerFunc TimerFunc)
func (*SmartbusModel) SetVirtualRelayOn ¶
func (model *SmartbusModel) SetVirtualRelayOn(channelNo int, on bool)
func (*SmartbusModel) Start ¶
func (model *SmartbusModel) Start() error
func (*SmartbusModel) Stop ¶
func (model *SmartbusModel) Stop()
func (*SmartbusModel) VirtualRelayStatus ¶
func (model *SmartbusModel) VirtualRelayStatus() []bool
type SmartbusStreamIO ¶
type SmartbusStreamIO struct {
// contains filtered or unexported fields
}
func NewStreamIO ¶
func NewStreamIO(stream io.ReadWriteCloser, rawReadCh chan []byte) *SmartbusStreamIO
func (*SmartbusStreamIO) Send ¶
func (streamIO *SmartbusStreamIO) Send(msg SmartbusMessage)
func (*SmartbusStreamIO) SendRaw ¶
func (streamIO *SmartbusStreamIO) SendRaw(msg []byte)
func (*SmartbusStreamIO) Start ¶
func (streamIO *SmartbusStreamIO) Start() chan *SmartbusMessage
func (*SmartbusStreamIO) Stop ¶
func (streamIO *SmartbusStreamIO) Stop()
type TimeoutChecker ¶
type VirtualRelayDevice ¶
type VirtualRelayDevice struct { wbgo.DeviceBase // contains filtered or unexported fields }
func NewVirtualRelayDevice ¶
func NewVirtualRelayDevice() *VirtualRelayDevice
func (*VirtualRelayDevice) AcceptOnValue ¶
func (dm *VirtualRelayDevice) AcceptOnValue(name, value string) bool
func (*VirtualRelayDevice) AcceptValue ¶
func (dm *VirtualRelayDevice) AcceptValue(name, value string)
func (*VirtualRelayDevice) IsVirtual ¶
func (dm *VirtualRelayDevice) IsVirtual() bool
func (*VirtualRelayDevice) Publish ¶
func (dm *VirtualRelayDevice) Publish()
func (*VirtualRelayDevice) RelayStatus ¶
func (dm *VirtualRelayDevice) RelayStatus() []bool
func (*VirtualRelayDevice) SetRelayOn ¶
func (dm *VirtualRelayDevice) SetRelayOn(channelNo int, on bool)
type ZoneBeastBroadcast ¶
type ZoneBeastBroadcast struct { ZoneStatus []uint8 `sbus:"statusBytes"` ChannelStatus []bool `sbus:"channelStatus"` }
ZoneBeastBroadcast packets are sent by ZoneBeast at regular intervals
func (*ZoneBeastBroadcast) Opcode ¶
func (*ZoneBeastBroadcast) Opcode() uint16
type ZoneBeastDeviceModel ¶
type ZoneBeastDeviceModel struct { DeviceModelBase // contains filtered or unexported fields }
func (*ZoneBeastDeviceModel) AcceptOnValue ¶
func (dm *ZoneBeastDeviceModel) AcceptOnValue(name, value string) bool
func (*ZoneBeastDeviceModel) OnReadTemperatureValuesResponse ¶
func (dm *ZoneBeastDeviceModel) OnReadTemperatureValuesResponse(msg *ReadTemperatureValuesResponse)
func (*ZoneBeastDeviceModel) OnSingleChannelControlResponse ¶
func (dm *ZoneBeastDeviceModel) OnSingleChannelControlResponse(msg *SingleChannelControlResponse)
func (*ZoneBeastDeviceModel) OnZoneBeastBroadcast ¶
func (dm *ZoneBeastDeviceModel) OnZoneBeastBroadcast(msg *ZoneBeastBroadcast)
func (*ZoneBeastDeviceModel) Poll ¶
func (dm *ZoneBeastDeviceModel) Poll()
func (*ZoneBeastDeviceModel) Type ¶
func (dm *ZoneBeastDeviceModel) Type() uint16