A libery to connect to telegesis zigbee module. Bassed on implemtation of XBEE
Fork of xbee_lib by
Diff: telegesis.cpp
- Revision:
- 21:9c5b72a64495
- Parent:
- 20:070dc2050052
- Child:
- 22:e8a8edf8b45c
--- a/telegesis.cpp Sat Oct 19 18:47:59 2013 +0000 +++ b/telegesis.cpp Sat Oct 19 22:06:53 2013 +0000 @@ -198,6 +198,7 @@ int zigbee::UniCast(char *adr,char *payload) //Ascii mode with null terminated string { _zbee.printf("AT+UCAST:%s=%s\r",adr,payload); + // printf("AT+UCAST:%s=%s\r",adr,payload); // _zbee.scanf ("UCAST:%X,%X=%s ",&EUI64,&framesize,Zdata); return 1; } @@ -280,6 +281,11 @@ //Do something } else if (strstr(_responseFrameString,"UCAST:")) { //checke for incoming UCAST data //if (sscanf (_responseFrameString,"UCAST:%X,%X=%s ",&EUI64,&framesize,Zdata)>0) + p=strstr(_responseFrameString,"UCAST:"); + p=p+6; + strncpy(NetNodeID,p,16); + NetNodeID[16]=0; + Zdat=1; p=strstr(_responseFrameString,"="); if (p) { p++; @@ -298,7 +304,7 @@ if (strstr(_responseFrameString,"NEWNODE:")) { //NEWNODE: <NodeID>,<EUI64>,<Parent NodeID> //new node on the pan p=strstr(_responseFrameString,"NEWNODE:"); - p=p+8; NetInfo=1; + p=p+13; NetInfo=1; strncpy(NetNodeID,p,16); }