Skip to content

Add Write Composite Operation#959

Merged
sbernard31 merged 7 commits intomasterfrom
write_composite
Mar 9, 2021
Merged

Add Write Composite Operation#959
sbernard31 merged 7 commits intomasterfrom
write_composite

Conversation

@sbernard31
Copy link
Copy Markdown
Contributor

@sbernard31 sbernard31 commented Jan 20, 2021

This aims to add Write Composite support.

Atomicity at client side is not supported.

API at server side looks like :

Map<String, LwM2mNode> nodes = new HashMap<>();
nodes.put("/3/0/14", LwM2mSingleResource.newStringResource(14, "+02"));
nodes.put("/1/0/2", LwM2mSingleResource.newIntegerResource(2, 100));

WriteCompositeResponse response = server.send(helper.getCurrentRegistration(),
        new WriteCompositeRequest(ContentFormat.SENML_COBOR, nodes));

This is not so good because resource Id is duplicate but for now I didn't find a better idea.

(This is a work in progress)

@sbernard31 sbernard31 changed the base branch from master to read_composite January 20, 2021 14:48
@sbernard31 sbernard31 marked this pull request as draft January 20, 2021 14:48
@sbernard31
Copy link
Copy Markdown
Contributor Author

sbernard31 commented Jan 29, 2021

This is probably not perfect but I think it's now in reviewable/testable state.

The WriteCompositeRequest API at server side is still not so good. Ideas are welcomed.

At client side :

@sbernard31
Copy link
Copy Markdown
Contributor Author

sbernard31 commented Mar 5, 2021

I changed the WriteCompositeRequest API to avoid this double Id issue, this looks like :

Map<String, Object> nodes = new HashMap<>();
nodes.put("/3/0/14", "+02");
nodes.put("/1/0/2", 100);

WriteCompositeResponse response = server.send(helper.getCurrentRegistration(),
        new WriteCompositeRequest(ContentFormat.SENML_COBOR, nodes));

@sbernard31
Copy link
Copy Markdown
Contributor Author

Still not entirely satisfied by the API an maybe we should go to something like #981.

@sbernard31 sbernard31 changed the base branch from read_composite to master March 9, 2021 16:57
@sbernard31 sbernard31 merged commit 6432a4b into master Mar 9, 2021
@sbernard31 sbernard31 deleted the write_composite branch June 3, 2021 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant