Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug lwm2m Content Format M14 #10844

Merged
merged 2 commits into from
May 22, 2024
Merged

Conversation

nickAS21
Copy link
Contributor

@nickAS21 nickAS21 commented May 22, 2024

Pull Request description

Problem:
When ContentFormat="lwm2m+tlv " is in the request and the client does not support it, then the lechan Client M14/M4 library code throws an error:

before:
{"result":"NOT_ACCEPTABLE"}

After:
application/src/test/java/org/thingsboard/server/transport/lwm2m/rpc/sql/RpcLwm2mIntegrationWriteCborTest.java
{"result":"CHANGED"}

General checklist

  • You have reviewed the guidelines document.
  • Labels that classify your pull request have been added.
  • The milestone is specified and corresponds to fix version.
  • Description references specific issue.
  • Description contains human-readable scope of changes.
  • Description contains brief notes about what needs to be added to the documentation.
  • No merge conflicts, commented blocks of code, code formatting issues.
  • Changes are backward compatible or upgrade script is provided.
  • Similar PR is opened for PE version to simplify merge. Crosslinks between PRs added. Required for internal contributors only.

Back-End feature checklist

  • Added corresponding unit and/or integration test(s). Provide written explanation in the PR description if you have failed to add tests.
  • If new dependency was added: the dependency tree is checked for conflicts.
  • If new service was added: the service is marked with corresponding @TbCoreComponent, @TbRuleEngineComponent, @TbTransportComponent, etc.
  • If new REST API was added: the RestClient.java was updated, issue for Python REST client is created.
  • If new yml property was added: make sure a description is added (above or near the property).

@nickAS21 nickAS21 added the Ignore for release Ignore this PR for release notes label May 22, 2024
Comment on lines +291 to +297
// decoders.put(ContentFormat.OPAQUE, new LwM2mNodeOpaqueDecoder());
decoders.put(ContentFormat.CBOR, new LwM2mNodeCborDecoder());
decoders.put(ContentFormat.SENML_JSON, new LwM2mNodeSenMLDecoder(new SenMLJsonJacksonEncoderDecoder(), true));
decoders.put(ContentFormat.SENML_CBOR, new LwM2mNodeSenMLDecoder(new SenMLCborUpokecenterEncoderDecoder(), false));
builder.setDecoder(new DefaultLwM2mDecoder(decoders));

// encoders.put(ContentFormat.OPAQUE, new LwM2mNodeOpaqueEncoder());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you leave commented code?

@ViacheslavKlimov ViacheslavKlimov merged commit 30d0e3b into master May 22, 2024
2 of 3 checks passed
@ViacheslavKlimov ViacheslavKlimov deleted the fix_bug_defaultContentFormat branch May 22, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ignore for release Ignore this PR for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants