一个好的串行通信协议/堆栈的嵌入式设备? [英] A good serial communications protocol/stack for embedded devices?

查看:227
本文介绍了一个好的串行通信协议/堆栈的嵌入式设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

写各个项目的几个不同的自定义串行协议之后,我开始变得沮丧重新发明轮子每一次。代替继续开发定制的解决方案,为每一个项目,我一直在寻找一个更通用的解决方案。我不知道是否有人串行协议知道(或更好,但实现)符合下列要求:

After writing several different custom serial protocols for various projects, I've started to become frustrated with re-inventing the wheel every time. In lieu of continuing to develop custom solutions for every project, I've been searching for a more general solution. I was wondering if anyone knows of a serial protocol (or better yet, implementation) that meets the following requirements:


  • 支持多台设备。我们希望能够支持一个RS485总线。

  • 有保证的收发。某种确认机制,以及一些简单的错误检测(CRC16可能是罚款)。

  • 不是主/从。理想的是,从机将能够以异步方式发送数据。这是大多只是出于美学原因,每个奴隶感觉不对我投票的概念。

  • 操作系统的独立性。理想的情况下它不会依赖于preemptive多任务环境可言。我愿意承认这一点,如果我能得到其他的东西。

  • ANSI C.我们需要能够编译几个不同的架构。

速度不是太大的问题的,我们愿意放弃一些速度,以满足部分其他需求。我们会,然而,要最大限度地减少所需的资源量。

Speed isn't too much of an issue, we're willing to give up some speed in order to meet some of those other needs. We would, however, like to minimize the amount of required resources.

我即将开始实施与捎带ACK和无选择性重复滑动窗口协议,但认为也许有人能救我的麻烦。有谁知道现有的项目,我可以利用的?或者也许是更好的策略?

I'm about to start implementing a sliding window protocol with piggybacked ACKs and without selective repeat, but thought that perhaps someone could save me the trouble. Does anyone know of an existing project that I could leverage? Or perhaps a better strategy?

更新

我曾经认真考虑一个TCP / IP实现的,但真的很希望更多的东西轻巧。许多TCP / IP的特点是矫枉过正我想要做的。我愿意接受(吝啬),或许我只想功能不包括在较轻的协议。

UPDATE
I have seriously considered a TCP/IP implementation, but was really hoping for something more lightweight. Many of the features of TCP/IP are overkill for what I'm trying to do. I'm willing to accept (begrudgingly) that perhaps the features I want just aren't included in lighter protocols.

更新2

感谢您的CAN的提示。我在过去看了一下,可能会使用它的未来。我真的很想库来处理确认,缓冲,重试等,虽然。我想我更想找一个网络/传输层而不是数据链路/物理层。

UPDATE 2
Thanks for the tips on CAN. I have looked at it in the past and will probably use it in the future. I'd really like the library to handle the acknowledgements, buffering, retries etc, though. I guess I'm more looking for a network/transport layer instead of a datalink/physical layer.

更新3

因此,它听起来就像是艺术在这方面的状态是:

UPDATE 3
So it sounds like the state of the art in this area is:


  • 系统下调TCP / IP协议栈。可能与像了lwIP 或的 uIP的

  • 系统基于CAN的实现,它可能会在很大程度上依赖CAN总线上,因此它不会对其他的物理层有用。如有些事可以展可以沿途帮助。

  • 一个HDLC或SDLC实现(如这个)。这可能是我们将采取的路线。

  • A trimmed down TCP/IP stack. Probably starting with something like lwIP or uIP.
  • A CAN based implementation, it would probably rely heavily on the CAN bus, so it wouldn't be useful on other physical layers. Something like CAN Festival could help along the way.
  • An HDLC or SDLC implementation (like this one). This is probably the route we'll take.

请放心,如果你遇到这个问题,发布更多的答案。

Please feel free to post more answers if you come across this question.

推荐答案

你有没有考虑 HDLC 或的SDLC

有也 LAP / D (链路访问协议,D信道)

There's also LAP/D (Link Access Protocol, D-Channel).

Uyless黑的数据链路协议始终是附近在我的书架 - 你可能会发现一些有用的材料有太多(甚至细读TOC及;研究不同的协议)

Uyless Black's "Data Link Protocols" is always nearby on my bookshelf - you might find some useful material in there too (even peruse the TOC & research the different protocols)

这篇关于一个好的串行通信协议/堆栈的嵌入式设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆