开发者

What application layer protocol should I use for controlling a device on a network?

I'm going to be controlling a device (Arduino-based) from a PC over Ethernet. What common application layer protocols are used for stuff like this? The communication would be almost entirely command-acknowledge, with maybe a little bit that sends a command and receives a small amount of result data.

One thing I'm cons开发者_Python百科idering is SNMP. Also, since it's an embedded device, I'd rather be unpacking binary structures than XML/JSON.


Something like SNMP might make sense if the communications are complex, but if the amount of data is small and the commands are simple, you may just want to create your own protocol. It's pretty easy to send and parse small binary structures. If the commands can vary in size, then a byte-count prefix is useful.

Also, while binary is easy to parse, ASCII is easier to look at if you ever need to monitor the network traffic, and easier to type if you want to use something like telnet to test, so consider a simple text-based protocol if it's not too much trouble.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜