xbee

package
v0.0.0-...-9363af4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

API frame structure https://www.digi.com/resources/documentation/Digidocs/90001942-13/#concepts/c_api_frame_structure.htm

Receive Packet - 0x90 https://www.digi.com/resources/documentation/Digidocs/90002002/#Reference/r_frame_0x90.htm

Remote AT Command Request - 0x17 https://www.digi.com/resources/documentation/Digidocs/90002002/#Reference/r_frame_0x17.htm

Remote AT Command Response - 0x97 https://www.digi.com/resources/documentation/Digidocs/90002002/#Reference/r_frame_0x97.htm

Transmit Request - 0x10 https://www.digi.com/resources/documentation/DigiDocs/90002002/Default.htm#Reference/r_frame_0x10.htm

Supported frames https://www.digi.com/resources/documentation/Digidocs/90001942-13/#reference/r_supported_frames_zigbee.htm

Index

Constants

View Source
const (
	TypeATCommandResponse              = ReceiveAPIFrameType(0x88)
	TypeModemStatus                    = ReceiveAPIFrameType(0x8A)
	TypeTransmitStatus                 = ReceiveAPIFrameType(0x8B)
	TypeReceivePacket                  = ReceiveAPIFrameType(0x90)
	TypeExplicitRxIndicator            = ReceiveAPIFrameType(0x91)
	TypeIODataSampleRxIndicator        = ReceiveAPIFrameType(0x92)
	TypeXBeeSensorReadIndicator        = ReceiveAPIFrameType(0x94)
	TypeNodeIdentificationIndicator    = ReceiveAPIFrameType(0x95)
	TypeRemoteATCommandResponse        = ReceiveAPIFrameType(0x97)
	TypeExtendedModemStatus            = ReceiveAPIFrameType(0x98)
	TypeOverTheAirFirmwareUpdateStatus = ReceiveAPIFrameType(0xA0)
	TypeRouterRecordIndicator          = ReceiveAPIFrameType(0xA1)
	TypeManyToOneRouteRequestIndicator = ReceiveAPIFrameType(0xA3)
	TypeJoinNotificationStatus         = ReceiveAPIFrameType(0xA5)
)
View Source
const (
	TypeATCommand                      = TransmitAPIFrameType(0x08)
	TypeATCommandQueueParameterValue   = TransmitAPIFrameType(0x09)
	TypeTransmitRequest                = TransmitAPIFrameType(0x10)
	TypeExplicitAddressingCommandFrame = TransmitAPIFrameType(0x11)
	TypeRemoteATCommandRequest         = TransmitAPIFrameType(0x17)
	TypeCreateSourceRoute              = TransmitAPIFrameType(0x21)
	TypeRegisterJoiningDevice          = TransmitAPIFrameType(0x24)
)

Variables

This section is empty.

Functions

func Fix64address

func Fix64address(address16 string) (string, error)

func Get64addressFrom16address

func Get64addressFrom16address(address16 string) (string, error)

func InitSerial

func InitSerial(name string, speed int)

func ReadSerial

func ReadSerial(fc chan<- APIFrame)

func Record16bitsAddress

func Record16bitsAddress(address64, address16 string)

func RecordSH

func RecordSH(address16, sh string)

func RecordSL

func RecordSL(address16, sl string)

func WriteAPIFameDataToSerial

func WriteAPIFameDataToSerial(fd APIFrameData) error

func WriteSerial

func WriteSerial(f APIFrame) error

Types

type APIFrame

type APIFrame struct {
	StartDelimiter byte
	Length         uint16 // [2]byte
	Data           []byte
	Checksum       byte
}

type APIFrameData

type APIFrameData interface {
	Bytes() ([]byte, error)
	FromBytes(b []byte) error
}

type ReceiveAPIFrameType

type ReceiveAPIFrameType uint8

type ReceivePacketFrameData

type ReceivePacketFrameData struct {
	Type            byte
	SourceAddress64 [8]byte
	SourceAddress16 [2]byte
	ReceiveOptions  byte
	ReceivedData    []byte
}

func NewReceivePacketFrameData

func NewReceivePacketFrameData() ReceivePacketFrameData

TODO really useful for frame that we receive? Don't we only need this for transmit frame types?

func (ReceivePacketFrameData) Bytes

func (f ReceivePacketFrameData) Bytes() ([]byte, error)

TODO really useful for frame that we receive? Don't we only need this for transmit frame types?

func (*ReceivePacketFrameData) FromBytes

func (f *ReceivePacketFrameData) FromBytes(b []byte) error

func (ReceivePacketFrameData) MarshalBinary

func (f ReceivePacketFrameData) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*ReceivePacketFrameData) UnmarshalBinary

func (f *ReceivePacketFrameData) UnmarshalBinary(data []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type RemoteATCommandRequestFrameData

type RemoteATCommandRequestFrameData struct {
	Type                 byte
	ID                   uint8 // byte
	DestinationAddress64 [8]byte
	DestinationAddress16 [2]byte
	RemoteCommandOptions byte
	ATCommand            [2]byte
	ParameterValue       []byte
}

func NewRemoteATCommandRequestFrameData

func NewRemoteATCommandRequestFrameData() RemoteATCommandRequestFrameData

func (RemoteATCommandRequestFrameData) Bytes

TODO really useful for frame that we receive? Don't we only need this for transmit frame types?

func (*RemoteATCommandRequestFrameData) FromBytes

func (f *RemoteATCommandRequestFrameData) FromBytes(b []byte) error

func (RemoteATCommandRequestFrameData) MarshalBinary

func (f RemoteATCommandRequestFrameData) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*RemoteATCommandRequestFrameData) SetATCommand

func (f *RemoteATCommandRequestFrameData) SetATCommand(ATCommand string) error

func (*RemoteATCommandRequestFrameData) SetDestinationAddress16

func (f *RemoteATCommandRequestFrameData) SetDestinationAddress16(address16 string) error

func (*RemoteATCommandRequestFrameData) SetDestinationAddress64

func (f *RemoteATCommandRequestFrameData) SetDestinationAddress64(address64 string) error

func (*RemoteATCommandRequestFrameData) UnmarshalBinary

func (f *RemoteATCommandRequestFrameData) UnmarshalBinary(data []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type RemoteATCommandResponseFrameData

type RemoteATCommandResponseFrameData struct {
	Type            byte
	ID              uint8 // byte
	SourceAddress64 [8]byte
	SourceAddress16 [2]byte
	ATCommand       [2]byte
	CommandStatus   byte
	ParameterValue  []byte
}

func (RemoteATCommandResponseFrameData) Bytes

TODO really useful for frame that we receive? Don't we only need this for transmit frame types?

func (*RemoteATCommandResponseFrameData) FromBytes

func (f *RemoteATCommandResponseFrameData) FromBytes(b []byte) error

func (RemoteATCommandResponseFrameData) MarshalBinary

func (f RemoteATCommandResponseFrameData) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*RemoteATCommandResponseFrameData) UnmarshalBinary

func (f *RemoteATCommandResponseFrameData) UnmarshalBinary(data []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransmitAPIFrameType

type TransmitAPIFrameType uint8

type TransmitRequestFrameData

type TransmitRequestFrameData struct {
	Type                 byte
	ID                   uint8 // byte
	DestinationAddress64 [8]byte
	DestinationAddress16 [2]byte
	BroadcastRadius      byte
	TransmitOptions      byte
	PayloadData          []byte
}

func NewTransmitRequestFrameData

func NewTransmitRequestFrameData() TransmitRequestFrameData

func (TransmitRequestFrameData) Bytes

func (f TransmitRequestFrameData) Bytes() ([]byte, error)

TODO really useful for frame that we receive? Don't we only need this for transmit frame types?

func (*TransmitRequestFrameData) FromBytes

func (f *TransmitRequestFrameData) FromBytes(b []byte) error

func (TransmitRequestFrameData) MarshalBinary

func (f TransmitRequestFrameData) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*TransmitRequestFrameData) SetDestinationAddress16

func (f *TransmitRequestFrameData) SetDestinationAddress16(address16 string) error

func (*TransmitRequestFrameData) SetDestinationAddress64

func (f *TransmitRequestFrameData) SetDestinationAddress64(address64 string) error

func (*TransmitRequestFrameData) SetPayloadData

func (f *TransmitRequestFrameData) SetPayloadData(payload []byte) error

func (*TransmitRequestFrameData) UnmarshalBinary

func (f *TransmitRequestFrameData) UnmarshalBinary(data []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

Jump to

Keyboard shortcuts

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