【发布时间】:2013-12-14 22:10:13
【问题描述】:
我正在设计一个 arduino 板与服务器通信的应用程序。我知道我需要做的第一件事是设计一个协议,但我不确定如何去做。功能描述如下所示
Arduino 将与服务器通信。放置 RFID 标签时 在 arduino 上,Arduino 必须立即启动通信 与服务器,这将完成,以便服务器打开其 数据库,搜索给定的标签,然后根据 服务器内的权限。即它将搜索 给定标签的数据库中的表,当找到时,它必须 识别标签所在的表并给出必要的 对arduino的权限。然后服务器将发送响应到 然后关闭连接的arduino板。所以我想出了 协议为
1)Initiation of communication
2)If Communication is successful,
arduino sends the received tag to the server and if not a signal is
shown on the arduino to state that connection was not feasible.
3)Server receives the tag, and uses it to verify priviledges and then
sends a yes or no to the arduino
4)Arduino closes communication
我不确定我是否可以断定这是我的协议,或者在协议设计中我需要进一步完善。任何帮助将不胜感激
【问题讨论】:
-
永远不要设计协议。已有数千个可用。
-
你设计了一种新的沟通方式吗?首先,查看OSI layers 并尝试找出将您的要求放在哪里。然后检查现有协议。如果您没有发现任何合适的内容,请继续使用您自己的协议 - 始终牢记它在 OSI 模型中的位置。
-
你能描述一下arduino使用什么样的链接来与服务器通信吗?如果您使用的是串行链接,那么您可以使用轻量级协议,这很好。但是,如果您通过以太网或蓝牙进行通信,那么它们有自己的基于 osi 模型的堆栈。您很可能需要将自己的部分放在应用层。
-
@praks411 ardiuno 使用以太网屏蔽,因此以太网是通信方式
标签: arduino protocols network-protocols