Documentation
¶
Index ¶
- Constants
- func Begin()
- func CalcChecksum(data []byte) byte
- func Close()
- func GetDeliveryStatusDescription(status byte) (description string)
- func GetDiscoveryStatusDescription(status byte) (description string)
- func GetModemStatusDescription(status byte) (description string)
- func GetReceiveOptionDescription(status byte) (description string)
- func Init(dev string, baud int, timeout int) (int, error)
- func SendATCommand(command []byte, param []byte) (d []byte, n int, err error)
- func SendPacket(address64 []byte, address16 []byte, option byte, data []byte) (d []byte, n int, err error)
- func SetupATCommandCallback(f ATCommandCallbackFunc)
- func SetupErrorHandler(f func(error))
- func SetupModemStatusCallback(f ModemStatusCallbackFunc)
- func SetupReceivePacketCallback(f ReceivePacketCallbackFunc)
- type ATCommandCallbackFunc
- type ModemStatusCallbackFunc
- type ReceivePacketCallbackFunc
Constants ¶
const ATCOMMAND = 0x08
const ATRESPONSE = 0x88
const EXPLICITRX = 0x91
const MODEMSTATUS = 0x8A
const RECEIVE = 0x90
const TRANSMIT = 0x10
const TXSTATUS = 0x8B
Variables ¶
This section is empty.
Functions ¶
func CalcChecksum ¶
func GetDeliveryStatusDescription ¶
*************************************************************** * GetDeliveryStatusDescription * Convert transmit delivery status code to description string * * Input: * status byte * Output: * description string * * **************************************************************
func GetDiscoveryStatusDescription ¶
*************************************************************** * GetDiscoveryStatusDescription * Convert transmit discovery status code to description string * * Input: * status byte * Output: * description string * * **************************************************************
func GetModemStatusDescription ¶
*************************************************************** * GetModemStatusDescription * Convert modem status code to description string * * Input: * status byte * Output: * description string * * **************************************************************
func GetReceiveOptionDescription ¶
*************************************************************** * GetReceiveOptionDescription * Convert transmit discovery status code to description string * * Input: * status byte * Output: * description string * * **************************************************************
func SendATCommand ¶
*************************************************************** * SendATCommand * Send AT command to the local device and apply changes immediately * * 0 - Start Delimiter * 1-2 - Length * 3 - Frame Type (0x08) * 4 - Frame ID * 5 - 6 - AT command * - optional parameter * 7 - checksum * **************************************************************
func SendPacket ¶
func SendPacket(address64 []byte, address16 []byte, option byte, data []byte) (d []byte, n int, err error)
*************************************************************** * SendPacket * Send data packet as an RF packet to the specified destination * * 0 - Start Delimiter * 1-2 - Length * 3 - Frame Type (0x10) * 4 - Frame ID * 5 - 12 - 64-bit address MSB-LSB * 13 - 14 - 16-bit address MSB-LSB * 15 - broadcast radius * 16 - options * 17 - n - RF data payload * n+1 - checksum * **************************************************************
func SetupATCommandCallback ¶
func SetupATCommandCallback(f ATCommandCallbackFunc)
func SetupErrorHandler ¶
func SetupErrorHandler(f func(error))
func SetupModemStatusCallback ¶
func SetupModemStatusCallback(f ModemStatusCallbackFunc)
func SetupReceivePacketCallback ¶
func SetupReceivePacketCallback(f ReceivePacketCallbackFunc)
Types ¶
type ATCommandCallbackFunc ¶
user defined callback functions declarations
type ModemStatusCallbackFunc ¶
type ModemStatusCallbackFunc func(status byte)