Closed tgagneret-embedded closed 4 years ago
Hi, first of all thank you for using Anjay and for your contribution! This is much appreciated!
However, I'm sorry, but I don't think we can accept your patch like this. Here is my reasoning for sticking to 64-bit integers there:
lt
parameter in the Register/Update messages, even though there are number of other places where %lld
and similar formats are used - most notably in the implementations of the plain-text and JSON data formats. Your patch would result in an unfortunate inconsistency - it may fix the problem with Register message for you, but you are likely to run into more problems when the server starts actually manipulating resources anyway.I suppose that the C library implementation that you use on your MCU may have a "larger" variant that includes support for 64-bit integers in printf()
/scanf()
family of functions. This is currently required for Anjay to work properly.
However, we acknowledge the problem that requiring full 64-bit integer support, including formatted I/O, is a problem for many small embedded platform. We will look into possibilities of resolving this issue in future versions.
I'm using Anjay on a MCU and I'm facing an issue with the conversion of lifetime using vnsprintf because %lld is not supported.
Since the specification gives lifetime as a 32bit integer we can use %li instead to make it work.
You can find the definition of lifetime p76: LWM2M Spécification
You can find the C data type here : C Data types