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

Updated IANA Content Format enums #44

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 31 additions & 7 deletions coap.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,40 @@ typedef enum
COAP_RSPCODE_CHANGED = MAKE_RSPCODE(2, 4)
} coap_responsecode_t;

//http://tools.ietf.org/html/rfc7252#section-12.3
// https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats
// http://tools.ietf.org/html/rfc7252#section-12.3
typedef enum
{
COAP_CONTENTTYPE_NONE = -1, // bodge to allow us not to send option block
COAP_CONTENTTYPE_TEXT_PLAIN = 0,
COAP_CONTENTTYPE_APPLICATION_LINKFORMAT = 40,
COAP_CONTENTTYPE_APPLICATION_XML = 41,
COAP_CONTENTTYPE_APPLICATION_OCTECT_STREAM = 42,
COAP_CONTENTTYPE_APPLICATION_EXI = 47,
COAP_CONTENTTYPE_APPLICATION_JSON = 50,

/* 0-255 Expert Review */
COAP_CONTENTTYPE_TEXT_PLAIN = 0 , // text/plain; charset=utf-8 /* Ref: [RFC2046][RFC3676][RFC5147] */
COAP_CONTENTTYPE_APPLICATION_COSE_ENCRYPT0 = 16 , // application/cose; cose-type="cose-encrypt0" /* Ref: [RFC8152] */
COAP_CONTENTTYPE_APPLICATION_COSE_MAC0 = 17 , // application/cose; cose-type="cose-mac0" /* Ref: [RFC8152] */
COAP_CONTENTTYPE_APPLICATION_COSE_SIGN1 = 18 , // application/cose; cose-type="cose-sign1" /* Ref: [RFC8152] */
COAP_CONTENTTYPE_APPLICATION_LINKFORMAT = 40 , // application/link-format /* Ref: [RFC6690] */
COAP_CONTENTTYPE_APPLICATION_XML = 41 , // application/xml /* Ref: [RFC3023] */
COAP_CONTENTTYPE_APPLICATION_OCTECT_STREAM = 42 , // application/octet-stream /* Ref: [RFC2045][RFC2046] */
COAP_CONTENTTYPE_APPLICATION_EXI = 47 , // application/exi /* Ref: ["Efficient XML Interchange (EXI) Format 1.0 (Second Edition)" ,February 2014] */
COAP_CONTENTTYPE_APPLICATION_JSON = 50 , // application/json /* Ref: [RFC4627] */
COAP_CONTENTTYPE_APPLICATION_JSON_PATCH_JSON = 51 , // application/json-patch+json /* Ref: [RFC6902] */
COAP_CONTENTTYPE_APPLICATION_MERGE_PATCH_JSON = 52 , // application/merge-patch+json /* Ref: [RFC7396] */
COAP_CONTENTTYPE_APPLICATION_CBOR = 60 , // application/cbor /* Ref: [RFC7049] */
COAP_CONTENTTYPE_APPLICATION_CWT = 61 , // application/cwt /* Ref: [RFC8392] */
COAP_CONTENTTYPE_APPLICATION_COSE_ENCRYPT = 96 , // application/cose; cose-type="cose-encrypt" /* Ref: [RFC8152] */
COAP_CONTENTTYPE_APPLICATION_COSE_MAC = 97 , // application/cose; cose-type="cose-mac" /* Ref: [RFC8152] */
COAP_CONTENTTYPE_APPLICATION_COSE_SIGN = 98 , // application/cose; cose-type="cose-sign" /* Ref: [RFC8152] */
COAP_CONTENTTYPE_APPLICATION_COSE_KEY = 101 , // application/cose-key /* Ref: [RFC8152] */
COAP_CONTENTTYPE_APPLICATION_COSE_KEY_SET = 102 , // application/cose-key-set /* Ref: [RFC8152] */
COAP_CONTENTTYPE_APPLICATION_COAP_GROUP_JSON = 256 , // application/coap-group+json /* Ref: [RFC7390] */
/* 256-9999 IETF Review or IESG Approval */
COAP_CONTENTTYPE_APPLICATION_OMA_TLV_OLD = 1542 , // Keep old value for backward-compatibility /* Ref: [OMA-TS-LightweightM2M-V1_0] */
COAP_CONTENTTYPE_APPLICATION_OMA_JSON_OLD = 1543 , // Keep old value for backward-compatibility /* Ref: [OMA-TS-LightweightM2M-V1_0] */
/* 10000-64999 First Come First Served */
COAP_CONTENTTYPE_APPLICATION_VND_OCF_CBOR = 10000, // application/vnd.ocf+cbor /* Ref: [Michael_Koster] */
COAP_CONTENTTYPE_APPLICATION_OMA_TLV = 11542, // application/vnd.oma.lwm2m+tlv /* Ref: [OMA-TS-LightweightM2M-V1_0] */
COAP_CONTENTTYPE_APPLICATION_OMA_JSON = 11543 // application/vnd.oma.lwm2m+json /* Ref: [OMA-TS-LightweightM2M-V1_0] */
/* 65000-65535 Experimental use (no operational use) */
} coap_content_type_t;

///////////////////////
Expand Down