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:
- 12:e62381cdc9de
- Parent:
- 11:7b5b9c1ab757
- Child:
- 13:e0c47bcc92e7
diff -r 7b5b9c1ab757 -r e62381cdc9de xbee.cpp
--- a/xbee.cpp Tue Feb 14 21:00:47 2017 +0000
+++ b/xbee.cpp Tue Feb 14 22:23:48 2017 +0000
@@ -404,19 +404,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)
{