xbeeapi

package module
v0.0.0-...-93c420a Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2016 License: MIT Imports: 6 Imported by: 1

README

xbeeapi

Xbee API Controller for ZigBee modules in Go.

Documentation

Index

Constants

View Source
const ATCOMMAND = 0x08
View Source
const ATRESPONSE = 0x88
View Source
const EXPLICITRX = 0x91
View Source
const MODEMSTATUS = 0x8A
View Source
const RECEIVE = 0x90
View Source
const TRANSMIT = 0x10
View Source
const TXSTATUS = 0x8B

Variables

This section is empty.

Functions

func Begin

func Begin()

func CalcChecksum

func CalcChecksum(data []byte) byte

func Close

func Close()

func GetDeliveryStatusDescription

func GetDeliveryStatusDescription(status byte) (description string)

*************************************************************** * GetDeliveryStatusDescription * Convert transmit delivery status code to description string * * Input: * status byte * Output: * description string * * **************************************************************

func GetDiscoveryStatusDescription

func GetDiscoveryStatusDescription(status byte) (description string)

*************************************************************** * GetDiscoveryStatusDescription * Convert transmit discovery status code to description string * * Input: * status byte * Output: * description string * * **************************************************************

func GetModemStatusDescription

func GetModemStatusDescription(status byte) (description string)

*************************************************************** * GetModemStatusDescription * Convert modem status code to description string * * Input: * status byte * Output: * description string * * **************************************************************

func GetReceiveOptionDescription

func GetReceiveOptionDescription(status byte) (description string)

*************************************************************** * GetReceiveOptionDescription * Convert transmit discovery status code to description string * * Input: * status byte * Output: * description string * * **************************************************************

func Init

func Init(dev string, baud int, timeout int) (int, error)

func SendATCommand

func SendATCommand(command []byte, param []byte) (d []byte, n int, err error)

*************************************************************** * 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

type ATCommandCallbackFunc func(frameId byte, data []byte)

user defined callback functions declarations

type ModemStatusCallbackFunc

type ModemStatusCallbackFunc func(status byte)

type ReceivePacketCallbackFunc

type ReceivePacketCallbackFunc func(destinationAddress64 [8]byte, destinationAddress16 [2]byte, receiveOptions byte, receivedData []byte)

Jump to

Keyboard shortcuts

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