cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Voyager
Voyager
4,262 Views
Registered: ‎10-25-2012

How to transfer different type data using ethernet?

Jump to solution

I try to use "tcp_write()" function in "tcp.c" to transfer data. However, it seems this function can only transfer "char" type data, if I want to transfer the data like int, short, float through ethernet, what function should I use?

 

Thanks very much.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Voyager
Voyager
5,469 Views
Registered: ‎02-10-2012

Re: How to transfer different type data using ethernet?

Jump to solution

Just typecast it to a character pointer. 

View solution in original post

0 Kudos
5 Replies
Highlighted
Voyager
Voyager
4,248 Views
Registered: ‎10-25-2012

Re: How to transfer different type data using ethernet?

Jump to solution

Anybody can help? Thanks.

0 Kudos
Highlighted
Voyager
Voyager
5,470 Views
Registered: ‎02-10-2012

Re: How to transfer different type data using ethernet?

Jump to solution

Just typecast it to a character pointer. 

View solution in original post

0 Kudos
Highlighted
Voyager
Voyager
4,239 Views
Registered: ‎10-25-2012

Re: How to transfer different type data using ethernet?

Jump to solution
So I guess you mean is, e.g. if we have an int type array, typecast it into a char type array, then transfer it as a char array. After it is received, then typecast it back to int type for further processing, right?

Thanks.
0 Kudos
Highlighted
Voyager
Voyager
4,230 Views
Registered: ‎02-10-2012

Re: How to transfer different type data using ethernet?

Jump to solution
Your original question was about tcp_write . I dont see how that has anything to do with receiving of data..

Besides that yes if you want to transfer just type cast anything into a character pointer .
0 Kudos
Highlighted
Voyager
Voyager
4,227 Views
Registered: ‎10-25-2012

Re: How to transfer different type data using ethernet?

Jump to solution
Yes, I only mentioned tcp_write. But the only transfer without receive will be meaningless. And I already tried what you suggested, it works.

Thanks very much.
0 Kudos