Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BACnet media type #357

Open
egekorkan opened this issue Apr 1, 2024 · 5 comments
Open

BACnet media type #357

egekorkan opened this issue Apr 1, 2024 · 5 comments

Comments

@egekorkan
Copy link
Contributor

In the BACnet binding, there is no usage of contentType in the examples so the default mechanism would apply and we would get JSON payloads. However, BACnet is not using JSON afaik. How should we handle this @fennibay ?

@fennibay
Copy link
Contributor

fennibay commented Apr 2, 2024

I understand that the logical payload is always JSON-based. contentType defines the physical payload on the wire.

BACnet always uses the same ASN.1-based encoding on the wire. It is implemented in the available BACnet stacks.

So from BACnet POV there is not really a need for a contentType field.

But for the sake of completeness we could define one as a default in schema. I checked the media types on IANA, and I don't see anything for BACnet or ASN.1. So we would have to register one on IANA first.

There is application/bacnet-xdd+zip, but that one is not for BACnet data, but a special BACnet file format, used for exchanging device descriptions.

@egekorkan
Copy link
Contributor Author

So from BACnet POV there is not really a need for a contentType field.

The issue is that if we don't define one, a TD process MUST automatically insert application/json (see here).

The contentType in a TD form doesn't have to be registered in IANA first (at least for now) so it should be fine to define one in the binding spec for now.

@fennibay
Copy link
Contributor

fennibay commented Apr 2, 2024

Ok, so can we define it like this?

"contentType": "application/X-bacnet"

@danielpeintner
Copy link
Contributor

danielpeintner commented Apr 4, 2024

Minor: I usually see lower-case content-types only...

Even though looking into https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.1 states some vague statements like

The type, subtype, and parameter name tokens are case-insensitive.
Parameter values might or might not be case-sensitive, depending on
the semantics of the parameter name.

@egekorkan
Copy link
Contributor Author

I propose to use "application/bacnet-x" to be aligned with lowercase throughout and starting with bacnet since the other bacnet media type starts like that too. Ideally, something should be registered to IANA. Any thoughts @ektrah and @mjkoster ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants