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

Disable acknowledgements if 0 retries requested #355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tim-ist
Copy link
Contributor

@tim-ist tim-ist commented Oct 9, 2015

PacketLink.setRetries(msg, 0) should disable ACKs
even if they were enabled for this msg before.

PacketLink.setRetries(msg, 0) should disable ACKs
even if they were enabled for this msg before.
@raidoz
Copy link
Contributor

raidoz commented Oct 14, 2015

So how would I send a single packet that I want an acknowledgement for? Request the ack after I have set retries to 0?

@tim-ist
Copy link
Contributor Author

tim-ist commented Oct 14, 2015

Well, there are contradicting descriptions for setRetries in TEP 127 and the PacketLink.nc.

The TEP says:

Sets the maximum number of times to retry the transmission of the message

The interface file:

Set the maximum number of times attempt message delivery
Default is 0
@param 'message_t* ONE msg'
@param maxRetries the maximum number of attempts to deliver the message

The implementation for CC2420 follows the one in the interface file. So, to send a single acknowledged packet maxRetries should be set to 1, while setting it to 0 will result in a single unacknowledged transmission.

@raidoz
Copy link
Contributor

raidoz commented Oct 16, 2015

Well, I don't necessarily see contradictions in the descriptions you listed, perhaps just the wording in the interface is bad/incorrect. A retry is an extra delivery, the

Set the maximum number of times attempt message delivery Default is 0

would kind of actually mean that setting this to 0 would result in no send being done at all, but then the variable name is still maxRetries, so I would just reword the description. Neither of them however has anything to do with the acknowledgements, but I guess since calling setRetries with a number larger than 0 would enable acknowledgements, then calling with 0 should perhaps revert things back. Though in practice Packet.clear should probably be called instead and then the necessary flags set again, since it is not really possible to revert the flags if several commands were issued on a packet - you don't know if the acknowledgements flag was set because the user set it or because retries were set at some point.

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