Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are a couple of enhancements that I made to the library for my own purposes that I don't believe impact the library negatively except for one item. Since power isn't an issue with my use, but speed and packet reliability is, here are the additions that I applied:
During the packet send routine, it will not return until the packet has been send. I changed that to return immediately if no sleep mode was specified. This allows my code to continue doing other things while the module is provided data by the interrupt routine.
When a send is completely by the Interrupt routine, instead of going to TXIDLE, I forced it to go into receive mode. This may be detrimental for battery applications so some additional code checking for a sleep state and conditionally going to a receive mode is probably needed here. I added this because I wanted to make sure that the RFM12B was listening at all times except during transmit.
Finally, I added a function for setting a receive call back function and then if it is set, then it is called as part of ReceiveComplete function. I noticed that if the receiver is active when send function is called, allof that data will be lost. With a call back function, that data can be saved. In my code, I call ReceiveComplete as part of the main loop, but actually handle the packet received in the callback function. If a callback function is not defined, functionally is the same as before. The only restriction is that the callback function cannot call the library's send function or the original data trying to be sent will be overwritten.
I have not tested this code with any of the examples, but other than a power drain in item #2, the changes I have made should not impact anything else.
In my project, power isn't an issue with my use, but speed and packet reliability is. I have been trying to make the RFM12B work as well as the XBEE modules, but so far there is very little tolerance for RF packet collisions. My (non library) software has to do quite a lot to track packets and retransmit. Unfortunately, the more RFM12B modules are active, the higher the collision rates get.
Thanks for the library, I hope these additions can help.