Hi,
You could try to use LwM2mInstanceEnablerFactory.java[1] to do
that.
// code sample :
initializer.setFactoryForObject(2, new
LwM2mInstanceEnablerFactory() {
@Override
public LwM2mInstanceEnabler create(ObjectModel model) {
return new MyObject(myArg)
}
});
Simon
[1]https://github.com/eclipse/leshan/blob/master/leshan-client-core/src/main/java/org/eclipse/leshan/client/resource/LwM2mInstanceEnablerFactory.java
Le 18/11/2015 11:57, Rarsonic Mato
Sunyer a écrit :
Thank you, Mr. Bernard.
I had actually found out about the client examples before
you replied, thanks anyway. The issue now is how to have the
enablers access data from somewhere else in an application's
memory, as all data read and written in the examples is
localized within the enabler classes or hardcoded. That is,
how could I transfer objects to an enabler in response time,
bearing in mind that by design you cannot pass parameters to
their constructors.
Best Regards,
Ramon Mato.
Date: Tue, 17 Nov 2015 16:18:22 +0100
From: contact@xxxxxxxxxxxxxxx
To: leshan-dev@xxxxxxxxxxx
Subject: Re: [leshan-dev] Working with Leshan
Hi,
Currently, there is no release of the 0.1.11 version
(still in development). I suppose you are using the
milestones release : 0.1.11-M5.
You could have a look to LeshanClientExample[1] to see how to handle read write
request at client side.
The API has changed a lot and I advice you to use
master[2] waiting we release the 0.1.11-M6. (which should be
available soon)
In master, we also have partial implementation of the
JSON format from a previous contribution, so if you want
to continue this work[3][4], you are welcome.
Why do you want to use the JSON format instead of TLV ? I'm
curious :)
Simon
[1] https://github.com/eclipse/leshan/blob/leshan-0.1.11-M5/leshan-client-example/src/main/java/org/eclipse/leshan/client/example/LeshanClientExample.java
[2] https://github.com/eclipse/leshan/blob/master/leshan-client-example/src/main/java/org/eclipse/leshan/client/example/LeshanClientExample.java
[3] https://github.com/eclipse/leshan/blob/master/leshan-core/src/main/java/org/eclipse/leshan/core/node/codec/json/LwM2mNodeJsonDecoder.java
[4] https://github.com/eclipse/leshan/blob/master/leshan-core/src/main/java/org/eclipse/leshan/core/node/codec/json/LwM2mNodeJsonEncoder.java
Le 16/11/2015 08:53,
Rarsonic Mato Sunyer a écrit :
To whom it may concern,
I am currently using Leshan release 0.1.11 for a
project of mine and I'd like to ask a question about
server-client interaction: how do you do it in order
for the client to listen for server requests (read,
write, and so on), if it's even possible in this
release?
Furthermore, there are still some features missing
that I'd like to employ. Mainly I'm talking about JSON
encoding when sending and receiving data (at the
moment plaintext, opaque and TLV formats are
supported). Could I code that feature in myself?
Best regards,
Ramon Mato.
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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
|