attie / libxbee3

A C/C++ library to aid the use of Digi XBee radios in API mode
GNU Lesser General Public License v3.0
66 stars 41 forks source link

For xbee2/data the Transmit Options are wrongly masked with 0x08. #24

Open lopelope opened 7 years ago

lopelope commented 7 years ago

For xbee2/data the Transmit Options is masked with 0x08. While the documentation says;

Transmit options
0x01 = Disable ACK
0x02 = Disable network address discovery
Set all other bits to 0.

Others bits seems to also be used to enable NACK messages (bit 2) and the Trace Route option (bit ?).

solution: removing line 110 in /modes/xbee2/data.c if (settings->broadcast) iBuf->data[pos] |= 0x08;

ref: https://www.digi.com/resources/documentation/Digidocs/90000991/Default.htm#reference/r_frame_0x10.htm%3FTocPath%3DOperate%2520in%2520API%2520mode%7CAPI%2520frame%2520overview%7C_____5

https://www.digi.com/resources/documentation/Digidocs/90000991/Default.htm#reference/r_nack_msg.htm?Highlight=nack

https://www.digi.com/resources/documentation/Digidocs/90000991/Default.htm#reference/r_dm_trace_routing.htm?Highlight=Trace%20Route%20option

lopelope commented 7 years ago

From the latest documentation of XBee DigiMesh 2.4 masking with 0x08 Enable a unicast Trace Route on all DigiMesh API packets.

XBee/XBee-PRO S2C DigiMesh 2.4 Radio Frequency (RF) Module User Guide https://www.digi.com/resources/documentation/Digidocs/90001506/Default.htm#reference/r_frame_0x10.htm?Highlight=0x10

XBee®/XBee-PRO DigiMesh 2.4 User Guide (There is a typo, this is not the NACK but Trace Route.) https://www.digi.com/resources/documentation/Digidocs/90000991/Default.htm#reference/r_frame_0x10.htm?Highlight=0x10

Since xbee2 is also for the XBee Series 2.5 ZNet modules, where 0x08 is for multicast transmission. See page 68 of http://ftp1.digi.com/support/documentation/90000866_G.pdf

I think the line should be

if (settings->multicast) iBuf->data[pos] |= 0x08;

1-xbee2-data-mode-broadcast-mask-0x08.patch.txt