drivers/at86rf2xx: Updated address API#12606
Conversation
|
Looks like you got it reversed again. masterthis PR |
Apparently, it was wrong in master. The most significant byte of long address of your board in master is So making the API more fool proof in regard to the byte order fixed that bug :-) |
|
Oh, the short address is now generated from the most significant bytes, not the least significant bytes. Let me change that back to the original behavior. |
|
OK. I tested with (I changed the long address of the second board from |
miri64
left a comment
There was a problem hiding this comment.
I talked to Hauke, who originally introduced the usage of uint64_t for the long address here, and he doesn't know anymore why he decided to do it this way. The approach with byte arrays seems far more sensible. So would ACK, however the asserts should be fixed according to the expected types for the given NETOPTs.
|
The address is still reversed - is this intended? beforeafter |
Kind of. The code in master markes the first byte as non globally unique and non multicast and then calls ntohll(), effectively marking the least significant byte instead of (as intended) the most significant byte. So I could keep the call to ntohll() (which doesn't really serve a purpose, as the numeric value of the address doesn't really matter). But in that case I would need to mark the last byte of the LUID instead of the first byte prior to the call of ntohll(), as this will become the MSB afterwards. So the L2 address will change no matter what when we want to fix the issue of having 802.15.4 long addresses incorrectly marked as multicast or/and as globally unique. And without the call to ntohll() the code size will be a tad smaller, so I favoured that. I could hover split this change out of the PR and keep the L2 address as in master for now, if you prefer. |
|
I'm not attached to the value or order of the L2 address - just wanted to make sure things are in order. :) |
benpicco
left a comment
There was a problem hiding this comment.
This is surely an improvement.
The address changes, but it will change again with the luid/Mac address dispatching changes.
|
May I squash? |
Changed the address getter and setter functions to avoid byte order confusion.
15d05d1 to
f0317c5
Compare
|
Squashed :-) |
Contribution description
Changed the address getter and setter functions to avoid byte order confusion. In addition, passing the value via pointer reduces the ROM size a bit on ARM and quite significantly on AVR.
Testing procedure
E.g.
ping6on a board equipped with an at86rf2xx transceiver should still work.Issues/PRs references
Split out of #12600, as this turned out surprisingly complex. (Or I turned out surprisingly incapable of getting this right...)