You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 28, 2019. It is now read-only.
JasonZell edited this page Feb 17, 2018
·
1 revision
Example Code
// Initializationconstuint8_t CommID = 1; // User defined, UNIQUE CommNode ID ( per Xbee)constuint8_t destCommID = 2; // Unique CommNode ID of the recipient of packets.constchar* comPortName = "COM10"; // The port number that Xbee is plug into(changes all the time, always check XCTU).constchar* destMac = "0013A20040917A31"; // Recipient XBee MAC Addressconstuint32_t baudRate = 57600// Baudrate, should be same across the board for all XBees
comnet::Comms GCSNode(commID); // initialize CommNode
GCSNode.LoadKey("01234567890ABCDEF"); // Add AES Key for encryption
GCSNode.InitConnection(ZIGBEE_LINK, comPortName, "", baudRate); // ZIGBEE_LINK means packet goes through Xbee,
GCSNode.AddAddress(destCommID , destMac ) // Add recipient CommNode ID and MAC Address.
GCSNode.LinkCallback(new Packet(), new comnet::Callback((comnet::callback_t)CallBackFunc)); //link callback to CommNode.
GCSNode.Run(); // Must call Run() before sending anything.// Sending packet
Packet data("Message");
GCSNode.Send(data, destCommID );