lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Sending out TCP-Data as integer type


From: Mark Lakata
Subject: Re: [lwip-users] Sending out TCP-Data as integer type
Date: Wed, 05 Dec 2012 13:37:49 -0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2

Read up on integers and how they are stored in memory http://en.wikipedia.org/wiki/Endianness

Try this

int data = "">

tcp_write(pcb, data, 4, 1); // I changed the 1 to a 4

tcp_output(pcb);


and see what you get in wireshark. You'll probably get


00 FF xx xx (where xx is don't care garbage since you have a big endian 16-bit architecture)

or

00 00 00 FF (since you have a 32 bit bit endian architecture)

-Mark




On 12/5/2012 6:38 AM, Firedog I. wrote:

Hi everyone,

 

I got a little problem over here. I can send simple TCP-Data like string and char, but I can’t send data as integer type. I’m using lwIP v1.36 with RAW API.

 

Example:

 

/*Connection to Client established…*/

int data = "" //or int data = "">

tcp_write(pcb, data, 1, 1);

tcp_output(pcb);

 

When sending this Packet out, I receive a “00” as data in Wireshark.

 

I’ve tried sending out the equal ASCII-char to 255, a “ÿ“ (see extended ASCII), and this one works. When sending out this char, Wireshark shows a TCP-Packet with 1 byte length and a "ff" as data. That’s exactly what I want, but I don’t want to convert integer vars into extended ascii and then send the converted data out.

 

Any suggestions how to solve the problem?

Thanks.




_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]