Sending Different Sized Integers together over TCP/IP
1 次查看(过去 30 天)
显示 更早的评论
I need to send a data packet in binary to a remote device via TCP/IP. The data packet format consists of a series of 8 bit unsigned integers and 16 signed integers that need to be sent together in twos complement representation. I am using fwrite to send binary data to the device. However, I can only write with one type of precision at a time. Are there other commands which I can use to send these different precision types together in one packet?
0 个评论
回答(1 个)
Nathan Crosty
2013-7-23
编辑:Nathan Crosty
2013-7-23
You might look into "packing" your values of different types using a structure and sending that, then of course unpacking them on the receiving end.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Instrument Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!