Diffusion C API  6.3.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
json.h File Reference

Utilities for converting CBOR-encoded data to JSON string representation. More...


 DEPRECATED (BUF_T *cbor_to_json(const char *cbor, size_t len))
 Convert binary (CBOR) data to a JSON string. More...

Detailed Description

Utilities for converting CBOR-encoded data to JSON string representation.

Copyright © 2017 Push Technology Ltd., All Rights Reserved.

Use is subject to license terms.

NOTICE: All information contained herein is, and remains the property of Push Technology. The intellectual and technical concepts contained herein are proprietary to Push Technology and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law.

Function Documentation

DEPRECATED ( BUF_T cbor_to_jsonconst char *cbor, size_t len)

Convert binary (CBOR) data to a JSON string.

This function is deprecated from version 6.1 onwards, and may be removed.

This function is useful for converting data received on a JSON topic from CBOR representation to a JSON string suitable for passing to a 3rd party JSON parser.

Note that this is introducing an extra step (i.e., CBOR -> string -> JSON) and if possible, you should read the CBOR tokens and convert them directly to JSON representation using facilities provided by your JSON library.

cborA pointer to memory containing CBOR-encoded data.
lenThe length of the CBOR-encoded data.
A pointer to a BUF_T containing a JSON string, or NULL on error.