question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not getting custom objects from registration using model provider and ObjectModelSerDes

See original GitHub issue

I want to know how much objects and resources are there with a particular client when it is getting registered. In register callback of Device Registration Interface I’ve written below code:

                        final ObjectModelSerDes serializer;
                        final LwM2mModelProvider modelProvider;
			serializer = new ObjectModelSerDes();
			modelProvider = myserver.getModelProvider();
			LwM2mModel model = modelProvider.getObjectModel(null);
			byte[] test12 = serializer.bSerialize(model.getObjectModels());
			System.out.println("models");
			String str = new String(test12, "UTF-8");
			System.out.println(str);

In output I’m getting details of Default object models (0 to 7) and I’m not getting detail about my custom object models. I tried understanding ObjectSpecServlet.java in leshan-server-demo code and ended up with above logic.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sbernard31commented, Nov 6, 2018

Once you have the objectLink you can retrieve the corresponding object model using server.getModelProvider() but this will works only to know which object are supported. (That’s here where we could provide a better API)

To know resources supported, I believe the only way with LWM2M is to use discover request on each object… 😕

0reactions
sbernard31commented, Feb 26, 2019

@NayangiriGoswamiGit I created a PR #657 to support object versioning. There is now new utility functions on Registration to get supported version of an object for a registration. See https://github.com/eclipse/leshan/pull/657/files#diff-cd77b361911b907b7b59f79409eeb341R318

And a LwM2mModelProvider which return only supported objects. See https://github.com/eclipse/leshan/pull/657/files#diff-5a532c30888fe3d248b10f6ffd3eef73R27

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notes on Enabling Activities for Custom Objects
Custom object records can only be associated with a call log in Salesforce CRM Call Center if activities are enabled for the object....
Read more >
Use custom objects - HubSpot Knowledge Base
Click the Type dropdown menu and select your custom object, then select your custom object property.
Read more >
Sunshine custom objects guide for admins - Zendesk help
This article contains the following sections: About custom objects; Enabling custom objects; Defining a custom object type; Adding object records; Modeling your ...
Read more >
Guide to Pardot Custom Objects: What You Can and Can't Do
Our guide gives you an unbiased point of view on Pardot Custom Objects, how to use them, what they can do, and what...
Read more >
Custom Objects | HTTP API - commercetools documentation
Custom Objects store arbitrary JSON-formatted data on commercetools Composable Commerce. Custom Objects allow you to persist data that does not fit the standard ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found