On Thursday 02 July 2015 15:19:03 ??? wrote: > Thiago, > > > > I?d just like to confirm one thing. > > My understanding from your explanation is if there is someone to wants to > use JSON, > > then it is very easy to add JSON parser and use it based on current > IoTivity API implementation. Is this correct?
Hello June In theory, yes. In practice, this will depend on how we structure the code. That was the original idea, when I wrote the proposal. Then when I started doing the work, it looked actually quite difficult to achieve, so the D&C codebase would insert CBOR unconditionally. To send JSON only, you'd need to go out of Iotivity and write your own stack. Since Erich took over the implementation, he's actually created an abstraction layer that could be used to encode in something different than CBOR. Whether that will actually work remains to be proven. Even then, there are no plans to hook up a JSON encoder or decoder, so in order to do JSON you'll have to modify IoTivity libraries or use another implementation. > And Dwarka will check if the line in red in Core Spec will be changed in > SWG. [cut] > f) The OIC Devices that receive this request shall respond in JSON which is > in conformance to 25 the JSON schema. In later versions of the > specification other formats could be included (e.g., 26 XML/EXI) Right, this will need to change. The CoAP request should include the formats that the client doing discovery accepts and that header must include format "application/cbor" (format ID 60). It can optionally contain others. The service being discovered can reply using any of the formats listed in the client's CoAP header. In practice, tiny servers will always reply in CBOR. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
