You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating an encoder for the env-object from the following CDDL:
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
vlo => tstr ), ; Object Link Value
0*5 key-value-pair ; To handle unordered maps; length-first ordered map keys
}
; now define the generic versions
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
vd = 8
vb = 4
vlo = "vlo"
degrees = vf
percent = vf
pascals = vf
aqi = vi
timestamp = vi
temperature_rid = n
humidity_rid = n
pressure_rid = n
timestamp_rid = n
iaq_rid = n
env-object = [
{
bn => "14205/0/", ; Custom Environment information object
temperature_rid => "0", ; Temperature Resource ID
degrees => float, ; temperature in degrees Celsius
},
{
humidity_rid => "1", ; Humidity Resource ID
percent => float, ; Relative humidity in percent
},
{
pressure_rid => "2", ; Atmospheric pressure Resource ID
pascals => float, ; Atmospheric pressure in pascals
},
{
iaq_rid => "10", ; Air Quality Index Resource ID
aqi => int .size 4 ; AQI value
},
{
timestamp_rid => "99", ; Timestamp Resource ID
timestamp => int .size 8 ; UNIX timestamp in milliseconds
},
]
I'm using the latest pip release 0.8.1.
Could we at least get a useful error message here?
The text was updated successfully, but these errors were encountered:
An extra indirection makes the code generation succeed:
temperature = {
n => "0", ; Temperature Resource ID
vf => float, ; temperature in degrees Celsius
}
humidity = {
n => "1", ; Humidity Resource ID
vf => float, ; Relative humidity in percent
}
pressure = {
n => "2", ; Atmospheric pressure Resource ID
vf => float, ; Atmospheric pressure in pascals
}
iaq = {
n => "10", ; Air Quality Index Resource ID
vi => int .size 4 ; AQI value
}
timestamp = {
n => "99", ; Timestamp Resource ID
vi => int .size 8 ; UNIX timestamp in milliseconds
}
env-object = [
temperature,
humidity,
pressure,
iaq,
timestamp
]
I get this error:
zcbor/zcbor/zcbor.py
Line 2702 in a9945b7
When generating an encoder for the
env-object
from the following CDDL:I'm using the latest pip release 0.8.1.
Could we at least get a useful error message here?
The text was updated successfully, but these errors were encountered: