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

Receive added (With suggested changes) #19

Merged
merged 6 commits into from
Jan 17, 2017

Conversation

DenniZr
Copy link
Contributor

@DenniZr DenniZr commented Jan 16, 2017

No description provided.

@DenniZr
Copy link
Contributor Author

DenniZr commented Jan 17, 2017

Should i do anything else? New to github

@jpmeijers
Copy link
Owner

No it's not necessary. I just need to merge it into master.

But let me just test a little more and think if this is the correct way of handling downlinks. I find this solution nice and simple, but I need to think about and test confirmed uplinks too.

What makes me think twice about how it is done now is that you always need to do a hasRX() after every TX. On the one hand this is a simple and understandable solution, which makes the library usable to more people, but a more elegant solution would be if the TX function returned a status.

For example at the moment tx() returns a false if the transmission was unsuccessful. And it returns true if it was successful and/or a acknowledgement was received. False is the same as 0, and true is a positive number. If we return a 1 for successful transmission and a 2 for successful transmission with data received, it could work well.

But as I said I need to think which way will be the best. I'd rather do it correctly now than changing the API later.

A separate result for when a downlink message is received saves us the trouble of checking a hasRx() flag every time.
Updated receive example to support this new format.
TODO: Test other examples too.
@jpmeijers
Copy link
Owner

The TX functions now return one of three enum values:

  • TX_FAIL = 0, //The transmission failed. In the case of a confirmed message that is not acked, this will be the returned value.
  • TX_SUCCESS = 1, //The transmission was successful. Also the case when a confirmed message was acked.
  • TX_WITH_RX = 2 //A downlink message was received after the transmission. This also implies that a confirmed message is acked.

@jpmeijers jpmeijers merged commit 844e170 into jpmeijers:master Jan 17, 2017
DenniZr added a commit to Kaasfabriek/RN2483-Arduino-Library that referenced this pull request Jan 24, 2017
Merge pull request jpmeijers#19 from Kaasfabriek/master
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.

2 participants