Documentation ¶
Index ¶
- Constants
- Variables
- func Snoop(rx, tx io.Reader) devices.MessageWriter
- type Command
- type Config
- func (config *Config) AutomaticLED() bool
- func (config *Config) AutomaticLinking() bool
- func (config *Config) ClearAutomaticLED()
- func (config *Config) ClearAutomaticLinking()
- func (config *Config) ClearDeadmanMode()
- func (config *Config) ClearMonitorMode()
- func (config *Config) DeadmanMode() bool
- func (config *Config) MarshalBinary() ([]byte, error)
- func (config *Config) MonitorMode() bool
- func (config *Config) SetAutomaticLED()
- func (config *Config) SetAutomaticLinking()
- func (config *Config) SetDeadmanMode()
- func (config *Config) SetMonitorMode()
- func (config Config) String() string
- func (config *Config) UnmarshalBinary(buf []byte) error
- type Info
- type Option
- type PLM
- func (plm *PLM) Address() insteon.Address
- func (plm *PLM) Config() (config Config, err error)
- func (ldb *PLM) EnterLinkingMode(group insteon.Group) error
- func (ldb *PLM) EnterUnlinkingMode(group insteon.Group) error
- func (ldb *PLM) ExitLinkingMode() error
- func (plm *PLM) Info() (info *Info, err error)
- func (ldb *PLM) IterateDevices(cb func(insteon.Address)) error
- func (ldb *PLM) Links() ([]insteon.LinkRecord, error)
- func (plm *PLM) RFSleep() error
- func (plm *PLM) Read() (msg *insteon.Message, err error)
- func (plm *PLM) ReadPacket() (pkt *Packet, err error)
- func (plm *PLM) Reset() error
- func (plm *PLM) SetConfig(config Config) error
- func (plm *PLM) SetDeviceCategory(insteon.Category) error
- func (plm *PLM) String() string
- func (ldb *PLM) UpdateLinks(...insteon.LinkRecord) error
- func (plm *PLM) Write(msg *insteon.Message) (ack *insteon.Message, err error)
- func (ldb *PLM) WriteLinks(newLinks ...insteon.LinkRecord) (err error)
- func (plm *PLM) WritePacket(pkt *Packet) (ack *Packet, err error)
- type Packet
- type Version
Constants ¶
View Source
const ( LinkCmdFindFirst recordRequestCommand = 0x00 LinkCmdFindNext recordRequestCommand = 0x01 LinkCmdModFirst recordRequestCommand = 0x20 LinkCmdModFirstCtrl recordRequestCommand = 0x40 LinkCmdModFirstResp recordRequestCommand = 0x41 LinkCmdDeleteFirst recordRequestCommand = 0x80 )
Variables ¶
View Source
var ( ErrReadTimeout = errors.New("Timeout reading from plm") ErrNoSync = errors.New("No sync byte received") ErrNotImplemented = errors.New("IM command not implemented") ErrAckTimeout = errors.New("Timeout waiting for Ack from the PLM") ErrRetryCountExceeded = errors.New("Retry count exceeded sending command") ErrNoAck = errors.New("Received non-ack packet after transmit") ErrWrongAck = errors.New("Command in ACK does not match TX packet") ErrWrongPayload = errors.New("Payload in ACK does not match TX packet") ErrNak = errors.New("PLM responded with a NAK. Resend command") )
Functions ¶
Types ¶
type Command ¶
type Command byte
const ( CmdNak Command = 0x15 // NAK CmdStdMsgReceived Command = 0x50 // Std Msg Received CmdExtMsgReceived Command = 0x51 // Ext Msg Received CmdX10MsgReceived Command = 0x52 // X10 Msg Received CmdAllLinkComplete Command = 0x53 // All Link Complete CmdButtonEventReport Command = 0x54 // Button Event Report CmdUserResetDetected Command = 0x55 // User Reset Detected CmdAllLinkCleanupFailure Command = 0x56 // Link Cleanup Report CmdAllLinkRecordResp Command = 0x57 // Link Record Resp CmdAllLinkCleanupStatus Command = 0x58 // Link Cleanup Status CmdGetInfo Command = 0x60 // Get Info CmdSendAllLink Command = 0x61 // Send All Link CmdSendInsteonMsg Command = 0x62 // Send INSTEON Msg CmdSendX10 Command = 0x63 // Send X10 Msg CmdStartAllLink Command = 0x64 // Start All Link CmdCancelAllLink Command = 0x65 // Cancel All Link CmdSetHostCategory Command = 0x66 // Set Host Category CmdReset Command = 0x67 // Reset CmdSetAckMsg Command = 0x68 // Set ACK Msg CmdGetFirstAllLink Command = 0x69 // Get First All Link CmdGetNextAllLink Command = 0x6a // Get Next All Link CmdSetConfig Command = 0x6b // Set Config CmdGetAllLinkForSender Command = 0x6c // Get Sender All Link CmdLedOn Command = 0x6d // LED On CmdLedOff Command = 0x6e // LED Off CmdManageAllLinkRecord Command = 0x6f // Manage All Link Record CmdSetNakMsgByte Command = 0x70 // Set NAK Msg Byte CmdSetNameMsgTwoBytes Command = 0x71 // Set NAK Msg Two Bytes CmdRfSleep Command = 0x72 // RF Sleep CmdGetConfig Command = 0x73 // Get Config )
type Config ¶
type Config byte
func (*Config) AutomaticLED ¶
func (*Config) AutomaticLinking ¶
func (*Config) ClearAutomaticLED ¶
func (config *Config) ClearAutomaticLED()
func (*Config) ClearAutomaticLinking ¶
func (config *Config) ClearAutomaticLinking()
func (*Config) ClearDeadmanMode ¶
func (config *Config) ClearDeadmanMode()
func (*Config) ClearMonitorMode ¶
func (config *Config) ClearMonitorMode()
func (*Config) DeadmanMode ¶
func (*Config) MarshalBinary ¶
func (*Config) MonitorMode ¶
func (*Config) SetAutomaticLED ¶
func (config *Config) SetAutomaticLED()
func (*Config) SetAutomaticLinking ¶
func (config *Config) SetAutomaticLinking()
func (*Config) SetDeadmanMode ¶
func (config *Config) SetDeadmanMode()
func (*Config) SetMonitorMode ¶
func (config *Config) SetMonitorMode()
func (*Config) UnmarshalBinary ¶
type Option ¶
type Option func(p *PLM)
The Option mechanism is based on the method described at https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
func WriteDelay ¶
WriteDelay can be passed as a parameter to New to change the delay used after writing a command before reading the response.
type PLM ¶
type PLM struct {
// contains filtered or unexported fields
}
func (*PLM) EnterLinkingMode ¶
func (*PLM) EnterUnlinkingMode ¶
func (*PLM) ExitLinkingMode ¶
func (ldb *PLM) ExitLinkingMode() error
func (*PLM) IterateDevices ¶
func (*PLM) Links ¶
func (ldb *PLM) Links() ([]insteon.LinkRecord, error)
func (*PLM) ReadPacket ¶
func (*PLM) UpdateLinks ¶
func (ldb *PLM) UpdateLinks(...insteon.LinkRecord) error
func (*PLM) WriteLinks ¶
func (ldb *PLM) WriteLinks(newLinks ...insteon.LinkRecord) (err error)
Click to show internal directories.
Click to hide internal directories.