Bug 447605 - [content-type] wakaama don't use CoAP content-type/media-type information
Summary: [content-type] wakaama don't use CoAP content-type/media-type information
Status: NEW
Alias: None
Product: Wakaama
Classification: IoT
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-16 12:48 EDT by Simon Bernard CLA
Modified: 2014-10-16 12:48 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Bernard CLA 2014-10-16 12:48:11 EDT
Wakaama don't use the content-type/media-type information to know if the payload is Text or TLV.

Currently, resource requests is supposed to be in Text format and others requests in TLV.

The specification (8.1) say : 
"The Content-Type Option MAY be used to indicate the media type of the payload. A default value of plain/text is assumed, allowing this option to be elided for most payloads."

The defined content-types are (see 6.3) : 
"application/vnd.oma.lwm2m+text"
"application/vnd.oma.lwm2m+tlv"
"application/vnd.oma.lwm2m+json"
"application/vnd.oma.lwm2m+opaque"

In CoAP the content type is defined as an integer, we don't found the code defintion for this 4 content-type.
(see :https://github.com/jvermillard/leshan/issues/28)

Waiting, we choose some value arbitrarily in leshan : 
"application/vnd.oma.lwm2m+text"   ->1541
"application/vnd.oma.lwm2m+tlv"    -> 1542
"application/vnd.oma.lwm2m+json"   -> 1543
"application/vnd.oma.lwm2m+opaque" -> 1544
When you will implement this feature, you could reuse it.

(https://github.com/jvermillard/leshan/blob/master/leshan-core/src/main/java/leshan/server/lwm2m/request/ContentFormat.java)