nymea-zigbee/libnymea-zigbee/zcl
Michael Zanetti df0b7e9c63 Rafactor handling of TSNs in ZCL to allow the application using it.
This patch separates the transactionSequenceNumber used for sending from the
one received. According to the specification, the transactionSequenceNumber is
not meant to equally increase on both ends, but instead really just be a "random"
number which allows to match a reply to a request. Syncing them on both ends
has the outcome to increase the likelyhood of collisions if a device sends
a notification at the same time we send a request and thus even may wrongly
interpret that incoming command as a reply to the request. In fact, ideally TSNs for
outgoing messages would stay away as far as possible from incoming ones.

The old code additionally had the problem that it would re-use the last received
TSN for outgoing requests, given it used a post-increment when reading
m_transactionSequenceNumber after setting it to the last received TSN.

The new code will use a single static upcounting TSN for all outgoing requests
but will still allow overriding it with a custom TSN of for some reason a certain
device requires a specific TSN (apparently those exist).
It will not do anything with incoming TSNs but forward them now to the application
layer which may decide to use it match its own transactions or to deduplicate packets.

This allows fixing the issue in nymea that remote controls sometimes produce duplicate
pressed events (seen most often with the Tradfri Symfonisk) by discarding commands that
didn't increase the TSN.
2022-01-22 13:51:21 +01:00
..
closures Rafactor handling of TSNs in ZCL to allow the application using it. 2022-01-22 13:51:21 +01:00
general Rafactor handling of TSNs in ZCL to allow the application using it. 2022-01-22 13:51:21 +01:00
hvac Rafactor handling of TSNs in ZCL to allow the application using it. 2022-01-22 13:51:21 +01:00
lighting Rafactor handling of TSNs in ZCL to allow the application using it. 2022-01-22 13:51:21 +01:00
manufacturerspecific/philips Rafactor handling of TSNs in ZCL to allow the application using it. 2022-01-22 13:51:21 +01:00
measurement Add invalid measurment filtering for measurement clusters 2021-05-21 08:54:49 +02:00
ota Rafactor handling of TSNs in ZCL to allow the application using it. 2022-01-22 13:51:21 +01:00
security Rafactor handling of TSNs in ZCL to allow the application using it. 2022-01-22 13:51:21 +01:00
zigbeecluster.cpp Rafactor handling of TSNs in ZCL to allow the application using it. 2022-01-22 13:51:21 +01:00
zigbeecluster.h Rafactor handling of TSNs in ZCL to allow the application using it. 2022-01-22 13:51:21 +01:00
zigbeeclusterattribute.cpp Add on off cluster and use zigbedatatype for atributes 2020-05-27 21:56:41 +02:00
zigbeeclusterattribute.h Add on off cluster and use zigbedatatype for atributes 2020-05-27 21:56:41 +02:00
zigbeeclusterlibrary.cpp Add warning for occupancy sensor value convertion 2020-11-28 17:05:09 +01:00
zigbeeclusterlibrary.h Add manufacturer specific philips cluster 2021-12-07 20:36:24 +01:00
zigbeeclusterreply.cpp Restructure error handling depnding on layer and add MAC layer errors to replies 2020-11-24 18:14:54 +01:00
zigbeeclusterreply.h Restructure error handling depnding on layer and add MAC layer errors to replies 2020-11-24 18:14:54 +01:00