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

Fork of xbee_lib by Tristan Hughes

Revision:
19:78f44233a12f
Parent:
18:10fcddf238c9
Child:
20:070dc2050052
--- a/telegesis.cpp	Fri Oct 18 16:49:02 2013 +0000
+++ b/telegesis.cpp	Fri Oct 18 17:42:24 2013 +0000
@@ -281,8 +281,13 @@
 void zigbee::readPacket()
 {
     //read and waits for the packet
-    while(b!=CR)
+    Timer t;
+    t.reset();
+    t.start();    
+    b=0;
+    while((b!=CR) & (t.read_ms() < 1000))
         if (_zbee.readable()) SeePacket();
+    t.stop();     
 }
 
 #endif
\ No newline at end of file