When a decoder microservice is used as a custom action to process a LwM2M payload, it would be useful to have access to the timestamp if it it present in the SenML-JSON/CBOR message.
That is, if the payload is received by the LwM2M agent as the result of a send, notification, or read operation, and contains a base timestamp (bt
):
[
{
"bn": "/72/",
"bt": 25462634,
"n": "1/2",
"v": 22.4
},
{
"n": "1/2",
"v": 22.9
},
{
"n": "1/2",
"v": 24.1
}
]
or a base timestamp (bt
) and an offset (t
):
[
{
"bn": "/72/",
"bt": 25462634,
"n": "1/2",
"v": 22.4,
"t": -5
},
{
"n": "1/2",
"v": 22.9,
"t": -30
},
{
"n": "1/2",
"v": 24.1,
"t": -50
}
]
then the timestamp (i.e. bt + t
) should be sent to the decoder microservice along with the resource value, e.g.:
{
"args":{
"resourcePath": "<<LWM2M Object Resource Path on the device>>"
},
"timestamp": "<<timestamp from resource payload>>",
"sourceDeviceId":"<<device Id>>",
"serviceKey":"<<The service key of the decoder microservice>>",
"value":"<<The value to be decoded (hex string)",
"status":"IN_PROGRESS"
}
In this way, the decoder microservice can set the time of any measurements, events, or alarms that it returns to the LwM2M agent.
Hi Martin,
We agreed that the interface should in general be reviewed to also include other improvements once we start working on it. But as this is becoming a bigger topic, it will take some time until we are able to work on it and implement the improvements.
Hi Martin,
thank you very much for raising your idea! We are currently in the process of collecting LwM2M related ideas, which we will discuss next week. I will keep you updated within this comment section.