Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Coordinator_node Router_node
Diff: xbee.cpp
- Revision:
- 17:cb6b423b45cd
- Parent:
- 16:13ab66e244c3
- Parent:
- 13:e0c47bcc92e7
- Child:
- 19:8da8068315da
--- a/xbee.cpp	Tue Feb 14 21:05:44 2017 +0000
+++ b/xbee.cpp	Wed Feb 15 01:41:28 2017 +0000
@@ -218,6 +218,10 @@
                     }
             }
         }
+        else
+        {
+            pcPrint("Not valid Frame\r\n");
+        }
     }
     return response;
 }
@@ -438,19 +442,26 @@
     cmdtosend[2] = 0x0E + dataLength;
     cmdtosend[3] = 0x10;        // Frame type
     cmdtosend[4] = 0x01;        // Frame number
-    cmdtosend[5] = adresse64msb & 0xFF000000;        // MSB adresse 64-bit 
-    cmdtosend[6] = adresse64msb & 0x00FF0000;
-    cmdtosend[7] = adresse64msb & 0x0000FF00;
-    cmdtosend[8] = adresse64msb & 0x000000FF;
-    cmdtosend[9] = adresse64msb & 0xFF000000;
-    cmdtosend[10] = adresse64msb & 0x00FF0000;
-    cmdtosend[11] = adresse64msb & 0x0000FF00;
-    cmdtosend[12] = adresse64msb & 0x000000FF; // LSB adresse 64-bit
-    cmdtosend[13] = adresse16 >> 16;                  // MSB adresse 16-bit
-    cmdtosend[14] = adresse16 && 0b0000000011111111;  // LSB adresse 16-bit
+    
+    cmdtosend[5]  = (adresse64msb & 0xFF000000) >> 24;  // MSB adresse 64-bit 
+    cmdtosend[6]  = (adresse64msb & 0x00FF0000) >> 16;
+    cmdtosend[7]  = (adresse64msb & 0x0000FF00) >> 8;
+    cmdtosend[8]  = adresse64msb & 0x000000FF;
+    
+    cmdtosend[9]  = (adresse64lsb & 0xFF000000) >> 24;
+    cmdtosend[10] = (adresse64lsb & 0x00FF0000) >> 16;
+    cmdtosend[11] = (adresse64lsb & 0x0000FF00) >> 8;
+    cmdtosend[12] = adresse64lsb & 0x000000FF;          // LSB adresse 64-bit
+    
+    cmdtosend[13] = adresse16 >> 8;                     // MSB adresse 16-bit
+    cmdtosend[14] = adresse16 & 0x00FF;                 // LSB adresse 16-bit
     cmdtosend[15] = 0x00;       // Broadcast Radius
     cmdtosend[16] = 0x00;       // Options
     
+    pcPrint("lsb : ");
+    printHexa(adresse64lsb);
+    pcPrint("\r\n");
+    
     // Set RF DATA
     if(data != NULL)
     {