Closed Ozame closed 8 months ago
Iam not sure but maybeManualDataSender
is what need ?
Do you test the it ? it is able to collect timestamped data then send all collected data ?
You can test its behavior with leshan-client-demo ? using this interactive command
help collect
Usage: collect [<paths>...]
Collect data to send it later with 'send' command
[<paths>...] Paths of data to collect.
help send
Usage: send [-c=<contentFormat>] (current-value | collected-value)
Send data to server
-c, --content-format=<contentFormat>
Name (e.g. SENML_JSON) or code (e.g. 110) of Content Format used to
send data.
Default : SENML_CBOR
Commands:
current-value Send current value
collected-value Send values collected with 'collect' command
You could have code example here :
and
If this doesn't match you need, could you try to explain why ? :pray:
Does that work for you ? should we close this issue ?
Yes, this actually looks to be exactly what we needed, thank you! I will close the issue.
Question
Currently the default
LeshanClient
creates an implementation ofSendService
that can be used to send data from the client to the server. This implementation contains both the sync and async versions of the send. However,DataSenderManager
used to send the data also supports the versions of sendData that takeTimestampedNodes
instead of plain LwM2mNodes:vs.
Would it make sense to include this timestamped option to the default client / SendService interface? Or would this be unnecessary bloat for most users? Currently, if the timestamps are needed, a custom client class, or at least a clientBuilder class, is needed.
Changes would be needed to
SendService
interface and theLeshanClient
for this. Implementation itself is trivial, e.g.Depending of course if we want the timestamp to be passed or automatically created.
This case comes up when we use the LWM2M send service to push event related measurements from the client. I'm not sure if it's a common use case or not.
If this sounds good, I could submit a PR for this.