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

Fixing "panic: invalid type for option 8: []string ([])" bug in server example. #13

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

Conversation

TobiasMende
Copy link

Adapting the SetPath function to their comment (setting LocationPath instead of URIPath)

Adapting server example to make use of the SetPath function instead of
setting the option directly. (Setting an array as options value failes
hence there is no such case in the toBytes function)

For repeating fields, it might be good to set the option in a for loop,
when receiving an array.

instead of URIPath)

Adapting server example to make use of the SetPath function instead of
setting the option directly. (Setting an array as options value failes
hence there is no such case in the toBytes function)

For repeating fields, it might be good to set the option in a for loop,
when receiving an array.
@dubek
Copy link
Collaborator

dubek commented Oct 12, 2015

@TobiasMende: Thanks for your contribution.

  1. The SetPath() and Path() functions deal with the URIHost option and not other options.
  2. Probably setting the URIPath option on a server-reply is not a normal CoAP conversation. I think that a CoAP client will use m.SetPath([]string{"house", "temperature"}) and the CoAP server will use m.Path() to examine the incoming request.
  3. If you still believe a fix is needed, please resolve the conflicts first.

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