Distributed Publish & Subscribe for IoT
json.h
Go to the documentation of this file.
1 
6 /*
7  *******************************************************************
8  *
9  * Copyright 2018 Intel Corporation All rights reserved.
10  *
11  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License");
14  * you may not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  *
25  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
26  */
27 
28 #ifndef _DPS_JSON_H
29 #define _DPS_JSON_H
30 
31 #include <stdint.h>
32 #include <dps/err.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
60 DPS_Status DPS_JSON2CBOR(const char* json, uint8_t* cbor, size_t cborSize, size_t* cborLen);
61 
78 DPS_Status DPS_CBOR2JSON(const uint8_t* cbor, size_t cborLen, char* json, size_t jsonSize, int pretty);
79 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif
DPS_Status DPS_JSON2CBOR(const char *json, uint8_t *cbor, size_t cborSize, size_t *cborLen)
Generate a CBOR encoded byte array from a JSON string.
int DPS_Status
The status code type.
Definition: err.h:41
Status codes.
DPS_Status DPS_CBOR2JSON(const uint8_t *cbor, size_t cborLen, char *json, size_t jsonSize, int pretty)
Generate a JSON string from a CBOR encoded byte array.