Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] help in object instance accessing

Hi,

The LwM2mInstanceEnabler represent a unique instance of a lwm2m object.
So you will have 1 instance of the class LwM2mInstanceEnabler (at java meaning) for 1 instance of Object instance (at lwm2m meaning).
So when you implement the "read", you should not need the id to access to the instance ("you already in it", the instance is accessible with "this").
If you want to manage all the instances in only one java object, you should extends the BaseObjectEnabler and add it after the ObjectInitializer
Something like that :

List<ObjectEnabler> objectEnablers = initializer.create(3,4,5)
List<LwM2mObjectEnabler>  enablers = new ArrayList<LwM2mObjectEnabler>(enablers);
enablers.add(new MyCustomObjectEnabler());
final LeshanClient client = new LeshanClient(clientAddress, serverAddress, enablers)

(The API is still experimental and clearly not perfect so feedbacks are welcome ;))

Simon

Le 28/04/2015 03:49, Foivos . a écrit :
help in object instance accessing

I try to bind a multiple instance object (using ObjectInitializer.setClassForObject() method)
with a class that implements LwM2mInstanceEnabler interface.
Since method read() of the LwM2mInstanceEnabler interface  has not object-instance-id as argument,
I am not able to access a specific instance.
Is there any alternative way to access a specific object instance?

Thank you.


_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev


Back to the top