A libery to connect to telegesis zigbee module. Bassed on implemtation of XBEE
Fork of xbee_lib by
telegesis.h
- Committer:
- gert_lauritsen
- Date:
- 2013-10-13
- Revision:
- 9:c8e4339ccc29
- Parent:
- 8:4682155753ec
- Child:
- 10:263f7251c111
File content as of revision 9:c8e4339ccc29:
#include "mbed.h" /** Zigbee interface class for configuring, sending and recieving data using an telegesis zigbee */ class zigbee { private: PinName _tx; PinName _rx; PinName _reset; public: zigbee(PinName tx, PinName rx, PinName reset); ~zigbee(); /** Gets the serial number/mac address of the zigbee and places it into serial_no. * @param serial_no array to store the serial of zigbee (must be 8 long). * @return Returns 1 on success. */ int GetSerial(int*); /** Sets the encryption key. This should be a 128-bit key. * @param key Pointer to the network key to set. * @return Returns 1 on success. */ int SetKey(char*); /** Recieves data sent to the xbee. * @param data_buf Pointer to the buffer to put recieved data into. * @param numchar Number of characters to read. If 0, will use the size of data_buf. */ void RecieveData(char*, int); /** Read data from zigbee */ int ATI(); /** * */ int PingOut(); /** Sends a ping to Coo */ int PanScan(); /** Scan the Pan for nodes */ int Establish_Network(); /** */ int JoinNetwork(); /** Join a pan */ int ScanNetwork(); /** Scan network */ int NetworkInfo(); /** Give info on what role the modem has in the network */ /** Sends data using the ascii mode */ int UniCast(char *adr,char *payload); /** Sends data using the binary mode */ int UniCastb(char *adr,char *payload, char payloadSize); /** Pulls Resetpin */ void Reset(); /** converts a string to a long */ unsigned long hexToLong(const char *hex); /** convertes a string to a int */ unsigned int hexToInt(const char *hex); /** */ int EUI64; /** COO or FBB */ char Devicetype[3]; /** Gives type of HW */ char HWType[15]; /** incomming data */ char Zdata[100]; int channel, NodeID, EPID,framesize; };