- Fixes error: IOTCLT-2539 Block wise messaging call-backs not working logically
- Allow TCP+TLS transport method to send larger messages without blockwising.
NOTE! These are internal changes required for cloud client. This has no direct relevance to any mbed-os functionality.
The nanostack hal's critical section uses a mutex for mutual exclusion,
which is nice for many use cases. But when one needs to use the critical
section from interrupts, the RTX will have a assertion failure and panic.
Add a configurable for mbed_lib, which can be used to enable a alternative
version of critical section, which uses the underlying OS primitives, which
disables the interrupts.
Note: the default behavior is not changed, one needs to override the
"nanostack-hal.critical-section-usable-from-interrupt" to have "true".
Reason for this change is that there is a need for sending events using
nanostack event queue from interrupt context, eg. from a socket callback.
The thread flag signaling mechanism is problematic if a separate event
loop thread is not used. The problem is, that one needs to know the
thread id of the loop dispathcer, and that knowledge can be derived
only from the caller thread of the initialization function.
Remove the magic connection from caller thread to dispatcher thread
by using event flags instead of thread flags on signaling. As the
event flags require the massive amount 20 bytes of RAM whereas
thread flags requires none, keep the code behind flag.
The separate eventloop thread may not be necessary on all uses, as one
can use the existing main thread for event dispatching. Add a
conditional nanostack-hal.event-loop-dispatch-from-application, which
disables the thread creation.
Note: the ns_hal_init must be ran from the same thread which will be
used to execute the event loop later.
- New API to control whether coap itself sends a next GET(block2) request or not
- Fixes error IOTCLT-2203 mbed-coap does not handle PUT or POST if they indicate a smaller block size preference
This PR implement https://tools.ietf.org/html/rfc7959#section-2.5
"The error code 4.13 (Request Entity Too Large) can be returned at any
time by a server that does not currently have the resources to store
blocks for a block-wise request payload transfer that it would intend
to implement in an atomic fashion. (Note that a 4.13 response to a
request that does not employ Block1 is a hint for the client to try
sending Block1, and a 4.13 response with a smaller SZX in its Block1
Option than requested is a hint to try a smaller SZX.)
Fixes errors reported in Github
- #4798
- Fixed Lwm2m blockwise data transfer (using Block1 option) with Leshan
- ARMmbed/mbed-client#512
- Fixed an ongoing blocktransfer (Block 1 option) interruption by out of order Block to return error 4.08 Request Entity Incomplete as specified in the coap specification.
- ARMmbed/mbed-client#511
- Fixed detected duplicate message duplications will not stop mbed-client
This commit includes:
* Add support for sending response to duplicate messages
* Add randomness for retransmission time
* Fix usage sn coap blockwise max time data stored
* CoAP parser option handler does not seem to handle "Option Length" completely according to spec
* Handle '0' value if duplication buffer size is set through the sn_coap_protocol_set_duplicate_buffer_size()
Add the attribute flash to enable priority inheritance and robust mode.
The robust flag allows mutexes held by terminated threads to be
properly released.
This commit includes
- Removing CoAP sources from mbed-client-c to its own repository.
- mbed-client-c is moved outside of mbed-os source tree because it is used by mbed-client, so
it will be part of mbed-client offering.
- CoAP sources are used by coap-service which is a part of nanostack deliveries hence coap now existing
as independent module under mbed-coap.
- Commit handles the interdepdency of coap-service with mbed-client-c because of coap sources, coap-service
header files are now fixed to point to right header directory.