-
Notifications
You must be signed in to change notification settings - Fork 819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RF] handle 64 bits values (except for UNO) #698
Conversation
8bd7b6d
to
0c98777
Compare
Arduino UNO is not enough powerfull to handle properly uint64_t in terms of memory so differenciate the variable type depending on the board type With this configuration ATMega will not be able to receive with simpleReceiving 64 bits values. Of course Json will work with 64 bits values for this board.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you decided where to use the TYPE_UL_ULL
type?
Co-authored-by: Leon Kiefer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. I don't like that we mix the types of the signals of the different gateways, but I don't know how to do it better.
@Legion2 Thanks for the advices on this PR! |
* rename TYPE_UL_ULL to SIGNAL_SIZE_UL_ULL * build deduplication function only when the relevant gateways are built * replace 2 dimensions array by a structure so as to handle the time with an uint32_t when using an ESP (instead of a uint64_t) * change storeValue and isAduplicate function names * point to the rcswitch revision with the new 40 bits protocol
#693
This PR enables to handle 64 bits values except for Arduino UNO.
Why limiting it on UNO, mainly to reduce the sketch size. To handle 64 bits values we need to activate
ARDUINOJSON_USE_LONG_LONG
and this activation generate a too big sketch for the Uno when using the RF gateway.Added to that I found also a limit on arduino boards, the usage of ·´strtoull´ function is not available. This function is not a lot used in the code. Only with the ´simpleReceiving` method.
This method is currently enable by default but the question of its relevantness is asked below :
https://community.openmqttgateway.com/t/vote-removing-simplereceiving-and-simplepublishing/1044
simpleReceiving and simplePublishing enables to receive and send with a lite payload (no json), it was the first data format supported by OpenMQTTGateway.
Now I suspect that json is the mostly i used format.
We could develop an ´strtoull´ for Arduino but before doing that I prefer to know the simpleReceiving usage.