-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xbee: fixed several bugs #4445
xbee: fixed several bugs #4445
Conversation
XBee 802.15.4 manual is at http://ftp1.digi.com/support/documentation/90000982_S.pdf See "Figure 23: TX Packet (16-bit address) frames" (p.95) for API format for destination address field for broadcast packet e99759f. See "Figure 25: RX packet (64-bit address) frames" and "Figure 26: RX Packet (16-bit address) frames" (p.96) for RSSI header field 5f56ef2. See Unicast Mode section (p.28) for behavior of short address and long address 5807145. See "Table 11: XBee / XBee-PRO commands" (p.41) for valid channels of XBee and XBee-PRO 7c36311. |
Awesome catches! Testing it now. |
first quick test results:
|
I tested using branch https://github.com/Yonezawa-T2/RIOT/tree/xbee_border_router, which contains other fixes on GNRC, particularly #4446 affects sender's IPv6 address and ICMPv6 check sum. |
@Yonezawa-T2, can you rebase, please? |
d5aed5a
to
61e2424
Compare
rebased. |
Should I split the PR into separate PRs? Some of the commits are bug fixes while others are enhancements. |
Reordered commits so that we can drop enhancement commits by git-reset. |
@@ -289,9 +307,19 @@ static int _set_addr_len(xbee_t *dev, uint16_t *val, size_t len) | |||
switch (*val) { | |||
case 8: | |||
dev->addr_flags |= XBEE_ADDR_FLAGS_LONG; | |||
|
|||
// disable short address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use c-style comments...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Rebased. |
ping @Yonezawa-T2 can you rebase again? sorry for the delay, I'll test this ASAP. |
Destination address is at tx_buf[5] and tx_buf[6] rather than tx_buf[4] and tx_buf[5]. Broadcast header is overridden by following code mistakenly.
Rebased. |
@kaspar030 can you look at the error? I cannot get why it's failing... |
It's failing because two commits need squashing (according to their commit messages). |
Oh... can we have a bit more output on that? |
@Yonezawa-T2 so, can you squash? I think this is ready :) I'll do some more tests in the mean time |
Oh yeah, but since there is no "error" or something like that, in the whole black output I wasn't unable to see it. Thanks! |
Works like a charm. Waiting for squashing and Murdock afterwards. |
XBee supports channels 0x0B-0x1A while XBee-PRO supports only 0x0C-0x17.
XBee sends short address even for `API_ID_TX_LONG_ADDR` if short address is enabled. This results in check sum error of ICMPv6 since the IP address is computed based on long address on the sender side while it is computed based on short address on the receiver side.
`_set_addr` is called from `xbee_init` with lower bytes of the long address. If `_set_addr` destructs the given address, the long address is also destructed.
When debugging multihop wireless network, it is useful to emulate non-transitive network, that is, node A can communicate with B and B can communicate with C, but A cannot communicate with C directly. If `XBEE_DENIED_ADDRESSES`, which is an array of XBee long addresses, is defined, packets from those addresses are dropped silently. Example: CFLAGS += "-DXBEE_DENIED_ADDRESSES={ 0x02, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0x02, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }"
[del]Rebased.[/del] |
ACK and GO! |
Needs backport |
Nope, already in releas branch. Sorry. |
Arghs... this is so confusing.... no it is not in release branch... please provide a backport... |
Yes it needs it :) |
This PR fixes several bugs in XBee driver.
tx_lock
is not unlocked_set_addr
destructs long address in memorySee commit messages for details.
Tested on OS X with modifications of #4443 and #4444.