AnsweredAssumed Answered

IDW01M1 - user data callback receives wrong data

Question asked by Jean-Marc Chiappa on Jun 15, 2017

Hi,

I'm using a nucleo L476RG + the mini-AP sample code.

I  join the mini-AP and connect a client to the server. I'm using putty and everything is fine.

I want to send one byte from my client to the server and I expect  to retreive it from my user data callback in the main.c.

 

When I send it, the content of the data_ptr buffer  starts ALWAYS with a 0x0a. It's very frustrating because parsing user data fails. here are some traces (I sent the 0x30 char from the client):

>>client joined callback...
6C:88:14:38:AB:4C0xd

 

Process_DeQed_Wind_Indication...............................................................................................0xd 0xa 0x2b 0x57 0x49 0x4e 0x44 0x3a 0x36 0x31 0x3a 0x49 0x6e 0x63 0x6f 0x6d 0x69 0x6e 0x67 0x20 0x53 0x6f 0x63 0x6b 0x65 0x74 0x20 0x43 0x6c 0x69 0x65 0x6e 0x74 0x3a 0x31 0x37 0x32 0x2e 0x32 0x34 0x2e 0x32 0x31 0x32 0x2e 0x32 0xd 0xa

 

+WIND:61:Incoming Socket Client:172.24.212.2
0xd 0xa 0x2b 0x57 0x49

 

Process_DeQed_Wind_Indication...
User callback: Client joined...
0x4e 0x44 0x3a 0x36 0x30 0x3a 0x4e 0x6f 0x77 0x20 0x69 0x6e 0x20 0x44 0x61 0x74 0x61 0x20 0x4d 0x6f 0x64 0x65 0xd 0xa
+WIND:60:Now in Data Mode
0xff 0xfb 0x1f 0xff 0xfb 0x20 0xff 0xfb 0x18 0xff 0xfb 0x27 0xff 0xfd 0x1 0xff 0xfb 0x3 0xff 0xfd 0x3 .0xd 0xa 0x2b 0x57 0x49 0x4e 0x44 0x3a 0x35 0x39 0x3a 0x42 0x61 0x63 0x6b 0x20 0x74 0x6f 0x20 0x43 0x6f 0x6d 0x6d 0x61 0x6e 0x64 0x20 0x4d 0x6f 0x64 0x65 0xd 0xa +WIND:59:Back to Command Mode
.........0xd 0xa 0x2b 0x57 0x49 0x4e 0x44 0x3a 0x36 0x34 0x3a 0x53 0x6f 0x63 0x6b 0x64 0x20 0x50 0x65 0x6e 0x64 0x69 0x6e 0x67 0x20 0x44 0x61 0x74 0x61 0x3a 0x31 0x3a 0x31 0x3a 0x31 0xd 0xa
+WIND:64:Sockd Pending Data:1:1:1
0xd 0xa .0x2b 0x57 0x49 0x4e 0x44 0x3a 0x36 0x34 0x3a 0x53 0x6f 0x63 0x6b 0x64 0x20 0x50 0x65 0x6e 0x64 0x69 0x6e 0x67 0x20 0x44 0x61 0x74 0x61 0x3a 0x32 0x3a 0x32 0x3a 0x33 0xd 0xa
+WIND:64:Sockd Pending Data:2:2:3

 


Process_DeQed_Wind_Indication...0xd 0xa 0x2b 0x57 0x49 0x4e 0x44 0x3a 0x36 0x30 0x3a 0x4e 0x6f 0x77 0x20 0x69 0x6e 0x20 0x44 0x61 0x74 0x61 0x20 0x4d 0x6f 0x64 0x65 0xd 0xa
+WIND:60:Now in Data Mode

 

Reached SockON_Data_Length

 


Process_DeQed_Wind_Indication...
Data Receive Callback...

 

content of buffer :
0xa
socket ID: 9
msg size: 1
chunk size: 1
0x30
Reached SockON_Data_Length

 

Data Receive Callback...
0 <- the char I've sent
content of buffer :
0x30 0xd
socket ID: 9
msg size: 2
chunk size: 2

It seems that the content of the buffer is shifted with the last '\n' of the previous command.

 

Please thank you to have a look and help me.

 

Regards,

Jean-Marc

Outcomes