net: lwm2m: SenML-CBOR Encoder and CDDL update

Added support for historical data encode by adding base time (bt)
and time (t) label. New labels are needed for Encoder so Decoder
is not regenerated.

Added support for SenML-CBOR to write time series data.
Use "bt" base time and "t" timestamp labels for data cache.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
This commit is contained in:
Juha Heiskanen 2022-09-12 13:08:02 +03:00 committed by Fabio Baltieri
commit 60d9948b67
5 changed files with 112 additions and 14 deletions

View file

@ -2,13 +2,15 @@ lwm2m_senml = [1* record]
record = {
? bn => tstr, ; Base Name
? bt => int .size 8, ; Base Time
? n => tstr, ; Name
? t => int .size 8, ; Time
? ( vi => int .size 8 // ; Integer Value
vf => float // ; Float Value
vs => tstr // ; String Value
vb => bool // ; Boolean Value
vd => bstr ), ; Data Value
0*3 key-value-pair ; To handle unordered maps; length-first ordered map keys
0*5 key-value-pair ; To handle unordered maps; length-first ordered map keys
}
; now define the generic versions
@ -17,7 +19,9 @@ key-value-pair = ( int => value )
value = tstr / bstr / int .size 8 / float / bool
n = 0
t = 6
bn = -2
bt = -3
vi = 2
vf = 2
vs = 3