CoAP Content-Format Option missing [Feature Request in CA Layer]
IoTivity does not send a Content-Format Option... [End of Feature Request]
Associated Bug (
): and when I send a message with a CoAP Content-Format Option the client crashes.
RFC7252 section 5.5.1. Representation says:
The payload of requests or of responses indicating success is
typically a representation of a resource ("resource representation")
or the result of the requested action ("action result"). Its format
is specified by the Internet media type and content coding given by
the Content-Format Option. In the absence of this option, no default
value is assumed, and the format will need to be inferred by the
application (e.g., from the application context). Payload "sniffing"
SHOULD only be attempted if no content type is given.
Implementation Note: On a quality-of-implementation level, there is
a strong expectation that a Content-Format indication will be
provided with resource representations whenever possible. This is
not a "SHOULD" level requirement solely because it is not a
protocol requirement, and it also would be difficult to outline
exactly in what cases this expectation can be violated.
I applied the attached patch to IoTivity to make it add the content format option every time when a payload is given to indicate that this is application/cbor payload. This is just some test code in a real system you should give the payload format in some option to that function.
There is an additional bug that parsing of this extension fails with this error message:
Usage: garageclient <0|1>
ConnectivityType: Default IP
ConnectivityType 0: IPv4
ConnectivityType 1: IPv6
Invalid input argument. Using IP as connectivity type
URI of the resource: /a/garage
Host address of the resource: coap://192.168.178.24:53339
List of resource types:
List of resource interfaces:
Getting Light Representation...
terminate called after throwing an instance of 'OC::OCException'
what(): Error: OptionID valid only from 2048 to 3000 inclusive.
Aborted (core dumped)
JIRA migration meta data
- JIRA Issue ID: IOT-624
- Reporter: hauke
- Assignee: josephlm
- Creator: hauke
- Created at: 2015-07-18T12:11:41.000-0700
- Found in Version: b6269c94 and 0.9.2-beta
- Fix in Version: 32ab1cba
- Issue Severity: Normal
- Reproducibility: Always (100%)
- Operating System: Ubuntu
- Hardware/ OEM Platform: None
- External URL: None
- Bugzilla ID: None
- Product: None
- Status: Closed
- Components: SDK
- Priority: P1
- Due Date: None
Issue Type: Bug
END of JIRA migration meta data