-
Notifications
You must be signed in to change notification settings - Fork 370
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
Wrong definition of COAP_MAX_TRANSMIT_WAIT #220
Comments
in the CoAP RFC: in the wakaama code: #define COAP_MAX_TRANSMIT_WAIT ((COAP_RESPONSE_TIMEOUT * ((2 ^ (COAP_MAX_RETRANSMIT + 1)) - 1) * COAP_ACK_RANDOM_FACTOR)) ** was translated into ^ (XOR in C) |
Indeed, it is 2 to the power of (MAX_RETRANSMIT + 1). It doesn't really have much of an impact on the correct behavior, since it is only used to guard against registration failure due to datagram loss. |
Can you review the fix here: #222 |
Thats not quite correct. It has to be something like
And then of course the function pow needs the |
I did it this way to avoid a dependency on math.h |
That's what I thought too, but its not the same. Alternatively a small pow function implementation might be added. |
try 2 using bit shifting |
That is definitely the more elegant solution 👍 |
Nice catch @vuzunov. How could I do that ?.. |
Fix COAP_MAX_TRANSMIT_WAIT value - issue #220
Fixed by #222 |
…SMIT_WAIT Fix COAP_MAX_TRANSMIT_WAIT value - issue eclipse-wakaama#220
The definition of COAP_MAX_TRANSMIT_WAIT in er-coap.h is wrong.
The caret is a binary XOR and not an operator for power calculation. Probably a pow() function shall be used instead.
The text was updated successfully, but these errors were encountered: