Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] ask for help: how to get request sender identity‏

Glad to hear the list has been helpful!  :)

So right now there assumption (obviously counter to spec) in the client is that there is one server.  I've been taking a look at implementing bootstrap and its becoming clear that Servers and Security objects need to be first-order citizens that would allow for better reasoning about requests both by the library and by the user of the library.  I would assume in the future the methods on LwM2mInstanceEnabler will need to pass the Server as a parameter (and other things once thought is given to enforcing ACL).

As for your second question, yes that is a bug.  The issue is line 175 of ObjectResource in leshan-core which should read something like:
LwM2mResponse response = nodeEnabler.execute(new ExecuteRequest(URI, exchange.getRequestPayload(), ContentFormat.fromCode(exchange.getRequestOptions().getContentFormat())));

instead of just using the new ExecuteRequest(URI).  I'm sort of on other things right now but I guess if it would be possible to try out that fix and see if it would work then that would be a simple fix to PR in :)

Cheers,


-JF


On Thu, May 14, 2015 at 5:06 PM, Foivos . <jfx666@xxxxxxxxxxx> wrote:
First of all I'd like to thank everybody for your help. Just to note that I am trying to use leshan library to implement  a proof of concept IoT distributed system.

The (first) problem I'm facing is that on the client side, when a request is coming from a server
I have no way of determining which server sent the request. In LwM2mInstanceEnabler interface the relevant methods (read(), write() execute() ) do not have any argument from which I can retrieve the server's identity.
So if I want e.g. to run different code on an incoming execute request, depending on server which made the request, I just can't. Is there any way to do that? Am I missing something?

As a different (and temporary) approach, I tried to pass on an execute request, the server's identity(a string identifier or ip etc.) as argument but even if I send the execute request with params, client always gets the params argument equal to null( method LwM2mInstanceEnabler.execute(int resourceid, byte[] params) ).
Is passing argument on execute request not impemented yet or am I doing something wrong?

thanks again for your time.

_______________________________________________
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