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

Update coap_content_type_t with iana content format registered ids #2474

Open
mofosyne opened this issue May 15, 2018 · 0 comments
Open

Update coap_content_type_t with iana content format registered ids #2474

mofosyne opened this issue May 15, 2018 · 0 comments

Comments

@mofosyne
Copy link

mofosyne commented May 15, 2018

https://github.com/contiki-os/contiki/blob/master/apps/er-coap/er-coap-constants.h#L140

I propose adding other official ids from https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats

Also what are the other IDs doing in here thats not in the iana? Is it something the community as agreed upon?

/* CoAP Content-Types */
typedef enum { // https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats
  /* 0-255  Expert Review */
  TEXT_PLAIN                   = 0    ,  //  text/plain; charset=utf-8                    /* Ref: [RFC2046][RFC3676][RFC5147] */
  TEXT_XML                     = 1    ,  //                                               /* Ref: ??? */
  TEXT_CSV                     = 2    ,  //                                               /* Ref: ??? */
  TEXT_HTML                    = 3    ,  //                                               /* Ref: ??? */
  APPLICATION_COSE_ENCRYPT0    = 16   ,  //  application/cose; cose-type="cose-encrypt0"  /* Ref: [RFC8152] */
  APPLICATION_COSE_MAC0        = 17   ,  //  application/cose; cose-type="cose-mac0"      /* Ref: [RFC8152] */
  APPLICATION_COSE_SIGN1       = 18   ,  //  application/cose; cose-type="cose-sign1"     /* Ref: [RFC8152] */
  IMAGE_GIF                    = 21   ,  //                                               /* Ref: ??? */
  IMAGE_JPEG                   = 22   ,  //                                               /* Ref: ??? */
  IMAGE_PNG                    = 23   ,  //                                               /* Ref: ??? */
  IMAGE_TIFF                   = 24   ,  //                                               /* Ref: ??? */
  AUDIO_RAW                    = 25   ,  //                                               /* Ref: ??? */
  VIDEO_RAW                    = 26   ,  //                                               /* Ref: ??? */
  APPLICATION_LINK_FORMAT      = 40   ,  //  application/link-format                      /* Ref: [RFC6690] */
  APPLICATION_XML              = 41   ,  //  application/xml                              /* Ref: [RFC3023] */
  APPLICATION_OCTET_STREAM     = 42   ,  //  application/octet-stream                     /* Ref: [RFC2045][RFC2046] */
  APPLICATION_RDF_XML          = 43   ,  //                                               /* Ref: ??? */
  APPLICATION_SOAP_XML         = 44   ,  //                                               /* Ref: ??? */
  APPLICATION_ATOM_XML         = 45   ,  //                                               /* Ref: ??? */
  APPLICATION_XMPP_XML         = 46   ,  //                                               /* Ref: ??? */
  APPLICATION_EXI              = 47   ,  //  application/exi                              /* Ref: ["Efficient XML Interchange (EXI) Format 1.0 (Second Edition)" ,February 2014] */
  APPLICATION_FASTINFOSET      = 48   ,  //                                               /* Ref: ??? */
  APPLICATION_SOAP_FASTINFOSET = 49   ,  //                                               /* Ref: ??? */
  APPLICATION_JSON             = 50   ,  //  application/json                             /* Ref: [RFC4627] */
  /* conflicting: APPLICATION_X_OBIX_BINARY = 51, */
  APPLICATION_JSON_PATCH_JSON  = 51   ,  //  application/json-patch+json                  /* Ref: [RFC6902] */
  APPLICATION_MERGE_PATCH_JSON = 52   ,  //  application/merge-patch+json                 /* Ref: [RFC7396] */
  APPLICATION_CBOR             = 60   ,  //  application/cbor                             /* Ref: [RFC7049] */
  APPLICATION_CWT              = 61   ,  //  application/cwt                              /* Ref: [RFC8392] */
  APPLICATION_COSE_ENCRYPT     = 96   ,  //  application/cose; cose-type="cose-encrypt"   /* Ref: [RFC8152] */
  APPLICATION_COSE_MAC         = 97   ,  //  application/cose; cose-type="cose-mac"       /* Ref: [RFC8152] */
  APPLICATION_COSE_SIGN        = 98   ,  //  application/cose; cose-type="cose-sign"      /* Ref: [RFC8152] */
  APPLICATION_COSE_KEY         = 101  ,  //  application/cose-key                         /* Ref: [RFC8152] */
  APPLICATION_COSE_KEY_SET     = 102  ,  //  application/cose-key-set                     /* Ref: [RFC8152] */
  APPLICATION_COAP_GROUP_JSON  = 256  ,  //  application/coap-group+json                  /* Ref: [RFC7390] */
  /* 256-9999  IETF Review or IESG Approval */
  APPLICATION_OMA_TLV_OLD      = 1542 ,  //  Keep old value for backward-compatibility    /* Ref: [OMA-TS-LightweightM2M-V1_0] */
  APPLICATION_OMA_JSON_OLD     = 1543 ,  //  Keep old value for backward-compatibility    /* Ref: [OMA-TS-LightweightM2M-V1_0] */
  /* 10000-64999  First Come First Served */
  APPLICATION_VND_OCF_CBOR     = 10000,  //  application/vnd.ocf+cbor                     /* Ref: [Michael_Koster] */
  APPLICATION_OMA_TLV          = 11542,  //  application/vnd.oma.lwm2m+tlv                /* Ref: [OMA-TS-LightweightM2M-V1_0] */
  APPLICATION_OMA_JSON         = 11543,   //  application/vnd.oma.lwm2m+json               /* Ref: [OMA-TS-LightweightM2M-V1_0] */
  /* 65000-65535  Experimental use (no operational use) */
  CONTENT_MAX_VALUE = 0xFFFF
} coap_content_type_t;

The key thing I would like to ensure is added is CBOR, as it will be useful to know if CBOR is being sent or not.

@mofosyne mofosyne changed the title Update coap_content_type_t Update coap_content_type_t with iana content format registered ids May 15, 2018
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

1 participant