Mark,
I think you had a little (but important) typo
Should be
tcp_write(pcb, *&*data, 4, 1);
(pass pointer to data into tcp_write)
Ian
On 6/12/2012 8:37 AM, Mark Lakata wrote:
Read up on integers and how they are stored in memory
http://en.wikipedia.org/wiki/Endianness
Try this
int data = 0xFF;
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 = 0xFF; //or int data = 255;
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
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users