ng_at86rf2xx: Implement CSMA en/disable and setting retries#3138
ng_at86rf2xx: Implement CSMA en/disable and setting retries#3138OlegHahm merged 1 commit intoRIOT-OS:masterfrom
Conversation
drivers/kw2xrf/kw2xrf.c
Outdated
There was a problem hiding this comment.
Is this change intensional?
nvm
The IEEE 802.15.4 (2011) standard also defines them as standard values. However, if one want to send out data at a precise time, without (unpredictable) delay, BE should be set to 0. Figure 11 (p. 23) in the IEEE 802.15.4 standard shows that the backoff-wait is performed always initially before CCA (and of course later again, if the channel was busy). Since this behaviour could be of interest for other MAC-protocols and is "hidden" in HW in this Atmel device, we should maybe document that somewhere in the driver. I think e.g. Contiki-MAC would expect a min BE value of 0 to avoid any delays before sending. The wait-time, after which the packet will be send again, is defined as:
|
That's actually a very good point. I wasn't aware that the random backoff wait is already active before the first attempt to transmitting. As I'm aiming for a MAC layer is even more important to me. So in the first step it would be ok for me to have minBE=0 as a default, but I guess this should be configurable somehow. While going through all the interfaces involved, I still fail to find a good place for this, as it's really hardware specific and maybe not well placed as a NETCONF option. What do you say? |
|
yes, I guess making this option configurable is a good idea. I actually think it should be an ordinary NETCONF option. All devices that implements CSMA/backoff in hardware will be able to set this option. All other devices simply don't implement it and will automatically return -ENOTSUP by design. But we should clarify in the documentation, that this option is explicitly described as hardware-only function. If the option can not be set, the MAC layer has to handle the CSMA/backoff procedure. @haukepetersen do you agree? To go further, this could even be an indication for the MAC layer to en/disable software CSMA/backoff. |
|
I'm without a computer for the next two and a half weeks - hence, someone else should review this. |
|
@OlegHahm ping |
drivers/include/ng_at86rf2xx.h
Outdated
sys/include/net/ng_netconf.h
Outdated
There was a problem hiding this comment.
Please add a semicolon, there were other options added below in the meanwhile.
d89b1ae to
91f8e27
Compare
|
@jremmert-phytec-iot I updated the docs and now _AUTOCCA and _CSMA options exist both in parallel. But there is no "AUTOCCA-emulation" for at86rf2xx yet. |
|
Please rebase. |
|
@daniel-k, willing to provide an extension to the |
91f8e27 to
1f19589
Compare
|
Rebased. Will look into |
fec3841 to
58bc85d
Compare
|
@OlegHahm |
|
I would suggest to add either a setter for |
|
@OlegHahm |
aa9f871 to
1ba806c
Compare
|
ACK. Please rebase and squash! |
1ba806c to
ac62a8c
Compare
ac62a8c to
6ac9443
Compare
|
You have to add a string representation of the new netopt types. |
6ac9443 to
6f705a5
Compare
|
@OlegHahm string representations added and squashed again |
ng_at86rf2xx: Implement CSMA en/disable and setting retries
When enabling CSMA it defaults to 4 retries and sets min BE to 3 and max BE 5. I'm not sure if these are sensible defaults, they are the reset values of the transceiver.
The BE cannot yet be configured though. I wasn't sure how to integrate the BE setting into the given interfaces, so any proposal is welcome!
I'm not sure if there is a way to test and verify this in the current state, but I've got more changes in the pipe that depend on this (namely TX feedback, see #3125).