A libery to connect to telegesis zigbee module. Bassed on implemtation of XBEE
Fork of xbee_lib by
Diff: telegesis.cpp
- Revision:
- 29:6711180763b6
- Parent:
- 28:c724a8921f01
- Child:
- 30:f9cdb6f62586
diff -r c724a8921f01 -r 6711180763b6 telegesis.cpp --- a/telegesis.cpp Fri May 09 10:40:27 2014 +0000 +++ b/telegesis.cpp Thu Jun 05 17:10:37 2014 +0000 @@ -313,21 +313,21 @@ GotFrame=1; _responseFrameString[_pos]=0; //Nul terminate _pos=0; -// printf("%s \r\n",_responseFrameString); + // printf("%s \r\n",_responseFrameString); if (strstr(_responseFrameString,"+UCAST:")) { //returns on that we have sendt something //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; + strncpy(In.ID,p,16); + In.ID[16]=0; + //Zdat=1; p=strstr(_responseFrameString,"="); if (p) { p++; - strcpy(Zdata,p); - Zdat=1; + strcpy(In.Data,p); + In.Ready=1; } } if (strstr(_responseFrameString,"LeftPAN:")) PanOnline=0; //Local node has left the Pan @@ -401,3 +401,9 @@ } #endif + + +void zigbee::SletZdata(void){ +int i; + for (i=0; i<ZdataSize ; i++) In.Data[i]=0; +} \ No newline at end of file