Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

Send token on error message. #31

Closed
wants to merge 1 commit into from
Closed

Conversation

sbernard31
Copy link
Contributor

When en error occured on a CoAP request, the response does not contain the Token. It seems this is a bug.

See CoAP specification :

"2.2. Request/Response Model ...

   Client              Server       Client              Server
      |                  |             |                  |
      |   CON [0xbc90]   |             |   CON [0xbc91]   |
      | GET /temperature |             | GET /temperature |
      |   (Token 0x71)   |             |   (Token 0x72)   |
      +----------------->|             +----------------->|
      |                  |             |                  |
      |   ACK [0xbc90]   |             |   ACK [0xbc91]   |
      |   2.05 Content   |             |  4.04 Not Found  |
      |   (Token 0x71)   |             |   (Token 0x72)   |
      |     "22.5 C"     |             |   "Not found"    |
      |<-----------------+             |<-----------------+
      |                  |             |                  |

I propose this patch which change a very small amount of code, but maybe this is not the best way.
Probably the lwm2m_handle_packet function should be refactored because it begins to be long, but I do not feel to change it :), I do not manage this part of code enough.

@dnav
Copy link

dnav commented Apr 18, 2014

This is indeed a bug.
The whole token mechanism needs to be reworked. This is the TODO item " - Add token in every message".
I will pull your change once the project is part of the Eclipse Foundation. (See issue #30)

@sbernard31
Copy link
Contributor Author

Oups, sry I just do 2 other pull request :/

@dnav
Copy link

dnav commented Apr 18, 2014

No problem. At least they are logged.

@jvermillard
Copy link
Contributor

@sbernard31 can you push the PR on the new eclipse repo: http://github.com/eclipse/wakaama ?
Thanks

@dnav
Copy link

dnav commented Mar 9, 2016

Project moved to http://github.com/eclipse/wakaama

@dnav dnav closed this Mar 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants