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

Fork of xbee_lib by Tristan Hughes

Revision:
24:5ed5311266b0
Parent:
23:8a7329b46e95
Child:
25:31120552e53c
diff -r 8a7329b46e95 -r 5ed5311266b0 telegesis.cpp
--- a/telegesis.cpp	Thu Nov 07 20:05:17 2013 +0000
+++ b/telegesis.cpp	Tue Nov 12 09:19:52 2013 +0000
@@ -18,7 +18,15 @@
 }
 
 void zigbee::Work() {
-  if (_zbee.readable()) readPacket();
+    //read and waits for the packet
+    Timer t;
+    t.reset();
+    t.start();    
+    b=0;
+    while((b!=CR) & (t.read_ms() < 1000))
+        if (_zbee.readable()) SeePacket();
+    t.stop(); 
+  //if (_zbee.readable()) readPacket();
 }
 
 bool zigbee::wait4str(char *p) //joinpan
@@ -324,7 +332,7 @@
             Devicetype[3]=0; //null termination                    
         }
         if (strstr(_responseFrameString,"ACK")) { //
-            PacketAck=1;
+            //PacketAck=1;
             p=strstr(_responseFrameString,":");
             p++; //P indholder nu SEQ nummer
             SeqNumber=hextoint(p);