A libery to connect to telegesis zigbee module. Bassed on implemtation of XBEE

Fork of xbee_lib by Tristan Hughes

Revision:
33:101f953225a6
Parent:
32:e44448cee1e1
Child:
34:1b57f1110d59
--- a/telegesis.cpp	Fri Nov 28 12:26:46 2014 +0000
+++ b/telegesis.cpp	Sun Feb 22 10:08:09 2015 +0000
@@ -248,8 +248,7 @@
 {
     PacketAck=0;
     _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);
+    strcpy(LastDestination,adr);
     Ok=0;
     return 1;
 }
@@ -386,14 +385,13 @@
             p++; //P indholder nu SEQ nummer
             SeqNumber=hextoint(p);
         }
-        if (strstr(_responseFrameString,"NAK")) {
+        if (strstr(_responseFrameString,"NACK")) { //Besked kom ikke igennem
             PacketAck=0;
             p=strstr(_responseFrameString,":");
             p++; //P indholder nu SEQ nummer
-            SeqNumber=hextoint(p);
+            NackNumber=hextoint(p);            
         }
-        if (strstr(_responseFrameString,"SEQ")) { //
-            // PacketAck=1;
+        if (strstr(_responseFrameString,"SEQ")) { //Besked er afsendt
             p=strstr(_responseFrameString,":");
             p++; //P indholder nu SEQ nummer
             SeqNumber=hextoint(p);