Giter VIP home page Giter VIP logo

Comments (4)

zubairhamed avatar zubairhamed commented on July 29, 2024 1

Thanks for the hint.

I just went through a major refactoring and now i'm fixing all my broken test cases.

I'll need to comb thru the CoAP specs again and start implementing/testing the fine details such as the one you've mentioned here.

from canopus.

zubairhamed avatar zubairhamed commented on July 29, 2024

@h0ru5 , Would the option identified as critical (Critical = (onum & 1) also apply to options beyond 256?

Unrecognized options of class "critical" that occur in a
Confirmable request MUST cause the return of a 4.02 (Bad Option)
response.  This response SHOULD include a diagnostic payload
describing the unrecognized option(s) (see Section 5.5.2).

from canopus.

h0ru5 avatar h0ru5 commented on July 29, 2024

The problem is: if the option is recognized or not is actually something that can be answered by the user of your library.

I would recommend to just document it that if there is a critical option with a number >255 where the application does not know how to handle, then the application should return the error, but not do any automated "Bad Option" replies in the library.

@mkovatsc : given your experience in CoAP, maybe you could comment how you would recommend handling critical non-standard Options for a library?

from canopus.

h0ru5 avatar h0ru5 commented on July 29, 2024

After discussing with some colleagues, the suggestion would be following:

  • to insert a function parallel to BytesToMessage (as Golang does not support optional parameters)
  • that has an additional parameter to accept a callback of type func(*CoapMessage msg, OptionCode code, []byte value) bool that gets called for every received extended Option allows users to handle custom/extended options.
  • The boolean return can indicate whether on not the option was handled

from canopus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.