ieee802154: clean-up (Intra-PAN behavior + broadcast)#5897
ieee802154: clean-up (Intra-PAN behavior + broadcast)#5897PeterKietzmann merged 5 commits intoRIOT-OS:masterfrom
Conversation
smlng
left a comment
There was a problem hiding this comment.
Tested this one on boards SAMR21 and REMOTE-REVB, works but ACK_REQ is on for broadcast.
| buf[1] |= IEEE802154_FCF_DST_ADDR_VOID; | ||
| break; | ||
| case 2: | ||
| if (memcmp(dst, ieee802154_addr_bcast, |
There was a problem hiding this comment.
This should be if(!memcmp(...)) ..., currently this PR introduces ACKs for broadcasts, which is unwise.
There was a problem hiding this comment.
Me everytime with these kind of functions ^^"...
| /** | ||
| * @brief Static initializer for broadcast address | ||
| */ | ||
| #define IEEE802154_ADDR_BCAST { 0xff, 0xff } |
There was a problem hiding this comment.
Why? This group defines special IEEE 802.15.4 addresses (IEEE802154_ADDR). So if other special addresses are later added this would look as unified IMHO.:
#define IEEE802154_BCAST_ADDR { 0xff, 0xff }
#define IEEE802154_FOO_ADDR ....
#define IEEE802154_BAR_ADDR ....
There was a problem hiding this comment.
mhm, this is a matter of taste --and grouping things.
I was thinking IEEE802154_BCAST_ADDR and IEEE802154_BCAST_ADDR_LEN together, so its an broadcast address which has address length (not broadcast length).
But, what matters most is that we get this PR/ fix through, and I don't want to start a naming discussion - such issues are all over the place, if we would look deep enough 😬
| * @brief Length in byte of @ref IEEE802154_ADDR_BCAST | ||
| */ | ||
| #define IEEE802154_BCAST (0x80) | ||
| #define IEEE802154_ADDR_BCAST_LEN (IEEE802154_SHORT_ADDRESS_LEN) |
There was a problem hiding this comment.
rename to IEEE802154_BCAST_ADDR_LEN
No, I don't mind. Actually I haven't had much time to work on this so thanks @miri64 for taking the reins. I still think that the PAN_COMP flag should be getting set before the call to |
That's the thing I don't understand: set where? There is no flag for this in |
smlng
left a comment
There was a problem hiding this comment.
you don't like my shorter version using !memcmp(), however: ACK.
Because it is misleading. The return value of |
d9b8648 to
ed34390
Compare
|
Squashed. |
Okay. But if this is the case then I guess the API documentation for the |
| * do ignore @p dst and @p dst_len and just set `ff:ff` | ||
| * (broadcast) as destination address | ||
| * @ref IEEE802154_FCF_FRAME_PEND, and | ||
| * @ref IEEE802154_FCF_ACK_REQ. |
There was a problem hiding this comment.
That's the thing I don't understand: set where? There is no flag for this in ieee802154_set_frame_hdr() defined anymore. It's purely dependent on the configuration of the input PANs, as you originally intended.
Okay. But if this is the case then I guess the API documentation for the flags parameter needs updating.
@aeneby Already ahead of you ;-)
There was a problem hiding this comment.
Yikes - missed that. Sorry for the noise.
|
ACK, finally :-)! Unfortunately Murdock fails for qemu-i386 builds. |
|
Mh yeah... The file was provided by @Kijewski, however non of the people with access to the server sprang into action yet :-/. |
|
Ah, that story :/ ... How do we proceed, wait until someone found that file? I assume all builds are failing now. |
|
We have two solution:
Sadly, the people that could do either of those seem to be MIA. |
|
Alternatively for this PR we can just say that |
|
I scanned Murdocks output to verify it's just qemu that fails. Let's wait until early afternoon if someone is able to fix the missing file. Otherwise I'll merge as is. |
|
Ok let's do this. ACK (again) and go. |
In #5685 (comment) we realized, that correcting our Intra-PAN behavior would also effect broadcasting behavior due to inconsistent handling of the broadcast/multicast flags from GNRC. This PR fixes that by getting rid of the IEEE802154_BCAST flag and replacing it with the IEEE802154_ADDR_BCAST constant. This way the broadcast address is handled like any other address in
ieee802154_set_frame_hdr()since the GNRC glue code now translates the (GNRC-internal) broadcast/multicast flags into the broadcast address, and not that function.Since this cleanup is tightly bound to the PAN_COMP clean-up (and it would have been more complicated to work around this changes, since I needed to touch that lines anyway) I decided to incorporate #5685 (due to the dropping of the
bcastvariable that change looks a little different though, so its more of an alternative) and #5759 in here. Hope @aeneby and @cgundogan won't mind ;).Summary of the changes
NETDEV2_IEEE802154_PAN_COMP+ change of the header setting behavior for PANs so that it is independent of external state (except the value of the given PAN IDs ;-))ieee802154_set_frame_hdr()so that it can be handled like any other destination address.netdev2_ieee802154flags)