It can happen that a plugin calls finish() in a slot which normally would be dispatched before the timeout
but due to high system load the slot is invoked only after the timeout. This in turn would cause Qt to also queue up
this timeout slot and by the time the system processes slots, the plugin comes in first and we'd fire an aborted()
signal in the plugin after it called finish(), potentially badly breaking the plugin as a plugin developer would not
expect this to happen. So we'll have to verify here that the plugin did not finish() by now before aborting.
nymea:app already implements this and many plugins do too. Apparently
most of the radiator thermostats support this, so it's worth making it
part of the interface.
This gives plugin developers a chance to finish() an info on their
own in an aborted() handler and set a custom error code and
displayMessage without causing a "finishing an already finished object"
warning.
CoIoT is a shelly specific extensions to CoAP:
It adds a new Request code which is not part of the CoAP spec
as well as using CoAP multicast (which is part of CoAP).
This commit
* renames "statusCode" to "reqRspCode" which describes
the actual field more precisely as it is in fact a Request or Response
code, not a status code.
* Allows joining multicast groups, by default using the CoAP specified
multicast address.
* Allows setting custom Request codes in requests, as well as
processing the PDUs Request/response code by the client.
* Fixed an indexOutOfRange warning when creating coap requests
because the first addOption() call was calling
m_options.insert(1) on an empty list.
* Old code was appending multiple UDP datagrams to a single big Coap
message, however, Coap is specified to only send s single datagram
per message. The datagram length specifies the payload size.
* some boolean member variables weren't initialized which resulted in
occational wrong flags.
* Parsing had issues with determining the option length in some occations
and also would crash when receiving coap messages without any options
or payload. To get rid of the complex and erraneous index calculations,
the entire package parsing is now using a DataStream.
(This makes it work with Shelly devices)
Fixes a theoretical memory leak (m_cacheSettings wasn't delete)
which isn't really an issue in practice but valgrind complains on it.
Fixes a typo: m_reties -> m_retries
When enabling a jitter filter on integer states (e.g. a signal
strength that repeatedly jumps up and down by 1), old code
may cause integer state to be populated with floating point values
as the filtering happens after the intial validation for the new
value being valid.