CAN 数据有 MIME 类型吗?
我有一个处理来自各种来源的消息的系统,我在每条传入消息上放置一个 MIME 类型,用于进一步分派。
传入的消息类型之一是来自控制器局域网 (CAN) 的数据帧。现在,这些数据通常不会通过 HTTP 或电子邮件等方式传输,因此维基百科或标准化组织不会给出 MIME 类型,至少不会在明显的地方给出。谷歌也帮不了我。
现在,我只是使用一些虚构的“application/vnd.*”MIME 类型,就像我已经使用一些内部协议一样。这还不错,但实际上并不正确,如果有人知道现有的 MIME 类型,我更愿意使用它。
I have a system that processes messages from various sources and I put a MIME type on each incoming message which is used for dispatching further down the line.
One type of messages coming in is data frames from a Controller Area Network (CAN). Now, this data usually isn't transmitted via HTTP or email etc., so Wikipedia or the standardizing organizations don't give a MIME type, at least not in an obvious place. Google couldn't help me, either.
For now, I'm just going with some made-up "application/vnd.*" MIME type, as I already do with some internal protocols. This is kinda OK, but it's not really correct, and if anybody knows of an existing MIME type, I would prefer to use it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CAN 仅针对 OSI 第 1 层(物理层)和第 2 层(数据链路层)进行定义。
MIME(多用途互联网邮件扩展)位于第 6 层(表示层)附近,仅描述来自第 7 层(应用层)之上的层或可能是它自己的层的信息。
因此,将 CAN 的 MIME 类型作为总线技术没有任何意义,因为您感兴趣的是“传输什么”而不是“如何传输”。
如果 CAN 有一个 MIME 类型,那么您还需要一个用于以太网、WiFi...烟雾信号的 MIME 类型 :-)
当然,您可以为通过 CAN 传输的信息定义和编码 MIME 类型。但这些与传输的数据有关,而不是 CAN 本身。
还可以通过 CAN 运行 IP 和 HTTP 协议,但这不是常见的用例。
CAN is only defined for OSI-Layers 1 (Physical Layer) and 2 (Data Link Layer).
MIME (Multipurpose Internet Mail Extensions) is somewhere around Layer 6 (Presentation Layer) and will only describe informations from the layer above number 7 (Application Layer) or maybe it's own layer.
So it would not make any sense to have a MIME type for CAN as a bus technology, because you are interested in "what is transfered" and not in "how it is transfered".
If there would be a MIME type for CAN, you would also need one for Ethernet, WiFi... smoke signals :-)
Of course you can define and encode a MIME types for your information you transfer over CAN. But then these are related to your data transfered and not to CAN itself.
It would also be possible to run IP and HTTP protocols over CAN, but this is no common usecase.