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

Server displaying incorrect for multiple object links information is sent from the client. #416

Closed
venpu opened this issue Oct 30, 2017 · 4 comments
Labels
bug Dysfunctionnal behavior demo Impact our demo (not libraries) server Impact LWM2M server

Comments

@venpu
Copy link

venpu commented Oct 30, 2017

Hello there,

I am testing the object link feature and found this issue.

When the client sends multiple object links of 0x00640001 (100:1) and 0x0065002(100:2) to the Leshan server, for some reason it only displays in the following format in the GUI. I don't see multiple object links in the server.

Resource 22 /3/0/22 Observe Read Write 0=0,0,6,5,0,0,0,2

Here is the sample hexdump of the COAP + LWM2M packet being sent to the server.

65 45 5d cf c1 99 af a5 d7 c2 2d 16 ff 88
16 0c 44 00 00 64 00 01 44 00 00 65 00 02

Can you please let me know if the scenario is supported or is there any issue from the server side.

Hope that helps.

Thank you.

@sbernard31 sbernard31 added bug Dysfunctionnal behavior demo Impact our demo (not libraries) server Impact LWM2M server labels Oct 30, 2017
@sbernard31
Copy link
Contributor

I write a quick junit tests and I decode your payload with Leshan I get :

public static void main(String[] args) throws TlvException {
        byte[] rawMessage = Hex.decodeHex("65455dcfc199afa5d7c22d16ff88160c440000640001440000650002".toCharArray());
        Message coapMessage = new UdpDataParser().parseMessage(rawMessage);
        System.out.println(coapMessage);

        byte[] payload = coapMessage.getPayload();
        Tlv[] tlv = TlvDecoder.decode(ByteBuffer.wrap(payload));
        System.out.println(Arrays.toString(tlv));

        LwM2mResource lwNode = LwM2mNodeTlvDecoder.decode(payload, new LwM2mPath("3/0/22"),
                new LwM2mModel(ObjectLoader.loadDefault()), LwM2mResource.class);
        System.out.println(lwNode);
}

Coap :

ACK-2.05   MID=24015, Token=c199afa5d7, 
OptionSet={"Content-Format":"application/vnd.oma.lwm2m+tlv"}, 
88 16 0c 44 00 00 64 00 01 44 00 00 65 00 02 

TLV :

[Tlv [type=MULTIPLE_RESOURCE, children=
     [Tlv [type=RESOURCE_INSTANCE, children=null, value=[0, 100, 0, 1], identifier=0],
      Tlv [type=RESOURCE_INSTANCE, children=null, value=[0, 101, 0, 2], identifier=0]],
 value=null, identifier=22]]

LM2MNode :

LwM2mMultipleResource [id=22, values={0=/101/2}, type=OBJLNK]

As you can see the both resource instances as the same identifier, this looks like a bug in the payload ?

@sbernard31
Copy link
Contributor

@venpu could you confirm this is a payload error from your client ?

@sbernard31
Copy link
Contributor

I add create a PR to send a CodecException if this happened instead of accept it silently.
I add a test case too.
see #426

@venpu
Copy link
Author

venpu commented Nov 10, 2017

Hi Bernard,

Correct. The TLV payload had the same identifier for the resource instance. Fixed that TLV encoder at the LWM2M client. Thanks for adding an additional test case to test the scenario and also raise an error.

Thanks!

@venpu venpu closed this as completed Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Dysfunctionnal behavior demo Impact our demo (not libraries) server Impact LWM2M server
Projects
None yet
Development

No branches or pull requests

2 participants