Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFM12B Library Ehancements #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

RFM12B Library Ehancements #5

wants to merge 5 commits into from

Conversation

davidhewing
Copy link

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:

  1. 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.

  2. 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.

  3. 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.

davidhewing and others added 5 commits June 11, 2013 13:59
Importing recent sercurity changes for the encryption code.
	modified:   RFM12B.h
	modified:   keywords.txt

Added a ClearToSend function to provide information back to the main
program as to the current state of the library.  If the interrupt routine
is busy receiving or sending data, this function returns a false.
This allows the main program to go on doing other tasks instead of
calling the send routine which in turn would just wait until the RF12 is
ready.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant