Closed VeijoPesonen closed 2 years ago
floatt is a C99 feature and the code generator doesn't inject include _ to a generated header file when needed.
struct numeric_ { union { int32_t _numeric_int; float_t _numeric_float; }; enum { _numeric_int, _numeric_float, } _numeric_choice; };
lwm2m_senml = [1* record] record = { ? bn => tstr, ; Base Name ? bt => numeric, ; Base Time ? n => tstr, ; Name ? t => numeric, ; Time ? ( v => numeric // ; Numeric Value vs => tstr // ; String Value vb => bool // ; Boolean Value vd => bstr ), ; Data Value * key-value-pair } ; now define the generic versions key-value-pair = ( label => value ) label = non-b-label / b-label non-b-label = tstr / uint b-label = tstr / nint value = tstr / bstr / numeric / bool ; numeric = number / decfrac numeric = int / float bver = -1 n = 0 s = 5 bn = -2 u = 1 t = 6 bt = -3 v = 2 ut = 7 bu = -4 vs = 3 vd = 8 bv = -5 vb = 4 bs = -6
main (fc9b5a6)
Float support is being fixed in #159
floatt is a C99 feature and the code generator doesn't inject include_ to a generated header file when needed.
CDDL used
cddl-gen version
main (fc9b5a6)