English 中文(简体)
Is there a MIME type for CAN data?
原标题:

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.

问题回答

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.





相关问题
Illustrator opening as PDF

I am coding a file sharing application for my office. One strange problem I am going through is the Illustrator files being opened in PDF when you hit the download button. This problem is triggered ...

Content Dispostion header set in PHP not working with Firefox

I have a form button that submits the data to generic script (the same page that the form is loaded from, index.php) and if the right POST variables are submitted to that script, it returns a PDF for ...

HowTo extract MimeType from a byte[] [duplicate]

I ve a web page that that can be used to upload files. Now I need to check if the file type is correct (zip, jpg, pdf,...). I can use the mimeType that comes with the request but I don t trust the ...

Upload vCard (.vcf) file to IIS7 Site

I m trying to upload a vcard file to a site i ve built with ASP.NET. It s hosted on an IIS7 server. I keep running into the "content type not allowed" error when i try to upload the file. I have ...

How to add mime-type for <video> element on Firefox?

Into this dir there are : OGV video (Theora/Vorbis) for Firefox MP4 video (H264/AAC) for Safari FLV video with a flash player (player.swf) for others browsers a template.html which contains a snippet ...

Adding Silverlight MimeType using adsutil

I have a script that creates an app pool, web site - and then I want to use adsutil to add the .xap MimeType. I see this: cscript adsutil.vbs set W3SVC//Root/MimeMap “.extension,mimetype” However, ...

In Mono/Gnome, how can I look up the icon for a mime type?

Gnome.Icon and Gnome.ThumbnailFactory both want me to pass in a URI of a file whose icon I want -- I only have a MIME type, which I want to look up an icon for. Is there a GNOME C# API function which ...

热门标签