Proposal for common 802.15.4 radio driver API definition.#925
Proposal for common 802.15.4 radio driver API definition.#925rousselk merged 1 commit intoRIOT-OS:masterfrom rousselk:radio-driver-api-proposal
Conversation
There was a problem hiding this comment.
Would it make sense to add a state for transmission in progress, maybe RADIO_TX_SENDING or something?
There was a problem hiding this comment.
Actually, I envision the send() function not to return until the final outcome of the transmission is known: a blocking function for the calling thread.
As Oleg noticed hereafter, this API will be mainly used by the MAC layer and/or low-level apps on limited devices. Higher-level systems shall probably continue to use the 'transceiver' and 'net_if' modules and their message passing system.
There was a problem hiding this comment.
Ok, I see. Sounds sensible.
|
Actually this PR reminds me a bit of what we once had in FeuerWare/µkleos and is for historical reasons still defined here: https://github.com/RIOT-OS/RIOT/blob/master/sys/include/radio/radio.h I'm not a fan of function pointers though. However, I see that for MAC protocols that might be more sensible than using IPC. |
|
Yes, as a MAC protocol developer, it would tremendously simplify my life. I can't really use the FeuerWare API since it doesn't separate the MAC and physical layers... Moreover, implementing this API doesn't prevent (unless I missed something) the ability to continue using the IPC mechanism, for people who prefer elegant solutions -- and have higher-end devices ;) |
|
@thomaseichinger et al: |
|
@LudwigOrtmann void (* load)(void *buf, unsigned len); // load transceiver TX buffer
radio_tx_status_t (* send)(void); // send what's inside transceiver TX bufferinstead of the current |
|
Rebased on master |
|
@rousselk |
|
Here you go. Also corrected a couple of mistakes. |
|
@thomaseichinger is this what you need? |
|
Yes, this would meet my requirements on a radio driver regarding OpenWSN. |
|
Rebased on master. |
drivers/include/radio_driver.h
Outdated
There was a problem hiding this comment.
As far as I understand the docs \c or @c only effect the word after and don't open a block like @code.
There was a problem hiding this comment.
Yes it seems so, corrected.
|
Corrected documentation, and completed the |
|
Rebased on master (again). |
|
Is this PR ready to be merged? |
|
I can't really judge the content, but as comments have been addresssed, you could squash the commits already. @authmillenon do you have any opinion on this? |
|
Squashed commits together. Ready to be merged if everyone agrees. |
|
There might be some corner cases, where this driver model might not be useful (e. g. multiple receive threads), but this can be easily circumvent with some kind of multiplexing layer (which might be needed at some point anyways, if we get more network stacks ;-)), maybe some adaption of |
|
in any way: ACK. |
|
Well, it seems this PR is ready. @OlegHahm @thomaseichinger no objections? |
|
looks good to me, ACK |
|
Let's move on, then! |
Proposal for common 802.15.4 radio driver API definition.
A possible common API for all 802.15.4 radio drivers.
Let me know what you think about it. If this is deemed worthy, I shall begin to adapt drivers to comply with the API (especially the CC2420 drivers).