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

Fork of xbee_lib by Tristan Hughes

Revision:
15:8d4990362a80
Parent:
14:dcf2390f89e2
Child:
17:5a3f81b10a61
--- a/telegesis.cpp	Fri Oct 18 06:18:20 2013 +0000
+++ b/telegesis.cpp	Fri Oct 18 08:50:58 2013 +0000
@@ -43,8 +43,19 @@
     return 1;
 }
 
-int zigbee::SetKey(char* key)
-{
+int zigbee::SetKey(char* key){
+/**
+S09:  the link key.  Write the same 128-bit number (32 hexadecimal characters) into every device
+
+S0A: security configuration.  You must set bit 4 in the coordinator, and set bit 8 in all other devices.  
+For more security set bit 2 also in the coordinator.  The devices ignore the bits that are not relevant 
+for them, so it is easiest to just set bits 8, 4, and 2 in all devices which gives S0A=0114.
+*/
+char psw[50];
+    sprintf(psw,"ATS09=%s;password\r",key);
+    _zbee.printf(psw);
+    wait4OK();   
+    _zbee.printf("ATS0A=0114;password\r");
     return 1;
 }