payloadlen was uint8_t in packet declaration, so packets could never have a payload bigger than 255 bytes. Changed to size_t everywhere.
In addition there are a number of fixes to help using this module in other packages:
Type callback changed to CoapCallback so it does not conflict with identifiers used in other packages.
Various defined size constants prefixed with COAP_ so they don't conflict, and made overridable using compiler flags.
Use a std::function in stead of a function pointer for callbacks. This makes integration with C++ methods a lot easier (and should be backward compatible).
Added a library.json to enable easy use of this package in platformio
This pull request contains one bug fix:
In addition there are a number of fixes to help using this module in other packages:
callback
changed toCoapCallback
so it does not conflict with identifiers used in other packages.COAP_
so they don't conflict, and made overridable using compiler flags.std::function
in stead of a function pointer for callbacks. This makes integration with C++ methods a lot easier (and should be backward compatible).library.json
to enable easy use of this package in platformio