PelionIoT / mbed-coap

CoAP C library - Builder and Parser for CoAP messages
Apache License 2.0
29 stars 16 forks source link

Allow size calculations to be skipped #118

Closed kjbracey closed 3 years ago

kjbracey commented 4 years ago

[X] I confirm this contribution is my own and I agree to license it with Apache 2.0. [] I confirm the moderators may change the PR before merging it in.

Summary of changes

To minimise ROM space, add an option for constant, skipping the size calculation.

kjbracey commented 4 years ago

Fixed up unit test - I'd taken out the "do size calculation" call from the build thinking it was only needed for the memset(0), but it also serves as a pre-sanity check for parameters.

(Which in turn means if the size calculation skip is enabled, there will be less parameter sanity checking.)

kjbracey commented 4 years ago

This is showing include problems on the test job Tero set up - I'm not sure what the correct fix for the failing environment is.

(And we're getting run-time problems on the device it was intended for, but that could be straightforward lack of memory).

kjbracey commented 4 years ago

Changed include in header from mbed-coap/sn_config.h to just sn_config.h, matching include style in other header, to try to resolve build issues.

Added tr_error in overflow return.