Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wakaama-dev] test case failed , ask for help, thanks very much.

Hi, Greg,

 

Thanks for your kind help, and I found another json parse issue when integrate with leshan server,   I write the package_URL to /5/0/1 by JSON format, and client parse failed, attachment is the debug log from client.

The difference with test_11 is that the value is empty for ā€œnā€ as below, and I add test_13 for this scenario, and it failed. so I wonder whether the leshan server is reasonable to send this kind of data, if so, then client need to handle it.

 

Leshan data :      {"bn":"/5/0/1","e":[{"n":"","sv":"http"}]}

Test_11 data:      {"bn":"/5/0/1","e":[{"n":"1","sv":"http"}]}

 

 

 

 

 

static void test_13(void)  failed

{  

    const char * buffer = "{\"bn\":\"/5/0/1\",\"e\":[{\"n\":\"\",\"sv\":\"http\"}]}";

 

    test_raw(NULL, (uint8_t *)buffer, strlen(buffer), LWM2M_CONTENT_JSON, "13");

 

}

 

 

 

 

 

-----Original Message-----
From: wakaama-dev-bounces@xxxxxxxxxxx <wakaama-dev-bounces@xxxxxxxxxxx> On Behalf Of Gregory Lemercier
Sent: Wednesday, August 22, 2018 10:26 PM
To: Wakaama developer discussions <wakaama-dev@xxxxxxxxxxx>
Subject: Re: [wakaama-dev] test case failed , ask for help, thanks very much.

 

Hi Zeng,

 

I investigated your issue and found a bug in the JSON parsing code. I created a PR with your unit tests and the fix here: https://github.com/eclipse/wakaama/pull/389

 

Everyone feel free to review and comment.

 

Thanks,

 

Greg

 

From: <wakaama-dev-bounces@xxxxxxxxxxx> on behalf of "Zeng, Liang 1. (NSB - CN/Hangzhou)" <liang.1.zeng@xxxxxxxxxxxxxxx>

Reply-To: Wakaama developer discussions <wakaama-dev@xxxxxxxxxxx>

Date: Wednesday 22 August 2018 at 11:14

To: "wakaama-dev@xxxxxxxxxxx" <wakaama-dev@xxxxxxxxxxx>

Subject: [wakaama-dev] test case failed , ask for help, thanks very much.

Resent-From: <g.lemercier@xxxxxxxxxxx>

Resent-Date: Wednesday 22 August 2018 at 11:14

 

Hi,

 

I try to add two test case as below, they have little difference(marked as yellow), one passed, and one failed, Does anybody know why ?

I think itā€™s the basic function of LWM2M_CONTENT_JSON format.

 

static void test_11(void)      failed(core dumped)

{   //{"bn":"/5/0/1","e":[{"n":"1","sv":"http"}]}

    const char * buffer = "{\"bn\":\"/5/0/1\",\"e\":[{\"n\":\"/1\",\"sv\":\"http\"}]}";

 

    test_raw(NULL, (uint8_t *)buffer, strlen(buffer), LWM2M_CONTENT_JSON, "11");

    printf("\n test_11 ok \n");

 

}

 

 

static void test_12(void)  passed

{   //{"bn":"/5/0/1","e":[{"n":"1","sv":"http"}]}

    const char * buffer = "{\"bn\":\"/5/0\",\"e\":[{\"n\":\"/1\",\"sv\":\"http\"}]}";

 

    test_raw(NULL, (uint8_t *)buffer, strlen(buffer), LWM2M_CONTENT_JSON, "11");

    printf("\n test_11 ok \n");

 

}

 

BRs,

Zeng Liang

 

 

 

_______________________________________________

wakaama-dev mailing list

wakaama-dev@xxxxxxxxxxx

To change your delivery options, retrieve your password, or unsubscribe from this list, visit

https://dev.eclipse.org/mailman/listinfo/wakaama-dev

[lwm2m_step:480] Final state: STATE_READY
64 bytes received from [127.0.0.1]:5683
48 03 87 66  6A 4E 62 B6  A3 AD 7B 26  B1 35 01 30   H..fjNb...{&.5.0
01 31 12 2D  17 FF 7B 22  62 6E 22 3A  22 2F 35 2F   .1.-..{"bn":"/5/
30 2F 31 22  2C 22 65 22  3A 5B 7B 22  6E 22 3A 22   0/1","e":[{"n":"
22 2C 22 73  76 22 3A 22  68 74 74 70  22 7D 5D 7D   ","sv":"http"}]}
[lwm2m_handle_packet:209] Entering
[lwm2m_handle_packet:221] Parsed: ver 1, type 0, tkl 8, code 0.03, mid 34662, Content type: 11543
[lwm2m_handle_packet:222] Payload: {"bn":"/5/0/1","e":[{"n":"","sv":"http"}]}
[handle_request:114] Entering
[uri_decode:102] altPath: "(null)"
[uri_decode:198] /5/0/1
[dm_handleRequest:172] Code: 03, server status: STATE_REGISTERED
[dm_handleRequest:173] /5/0/1
[dm_handleRequest:333] bufferLen: 42, buffer:{"bn":"/5/0/1","e":[{"n":"","sv":"http"}]} 
[object_write:221] /5/0/1
[object_write:222] bufferLen: 42, buffer:{"bn":"/5/0/1","e":[{"n":"","sv":"http"}]} 
[lwm2m_data_parse:527] format: LWM2M_CONTENT_JSON, bufferLen: 42, buffer:{"bn":"/5/0/1","e":[{"n":"","sv":"http"}]} 
[lwm2m_data_parse:528] /5/0/1
[json_parse:770] bufferLen: 42, buffer: "{"bn":"/5/0/1","e":[{"n":"","sv":"http"}]}"
[json_parse:771] /5/0/1
[json_parse:1023] Parsing failed
[object_write:246] result: 4. 6



Back to the top