| Connectivity Middleware Utilities Library

Functions
JSON parser functions
Common middleware utilities » JSON parser utilities

## General Description

The JSON parser utility library provides helper functions to parse JSON objects.

## Functions
cy_rslt_t | cy_JSON_parser_register_callback (cy_JSON_callback_t json_callback, void *arg)
| Register callback to be invoked by JSON parser while parsing the JSON data. More...
cy_JSON_callback_t | cy_JSON_parser_get_callback (void)
| Returns the current callback function registered with the JSON parser. More...
cy_rslt_t | cy_JSON_parser (const char *json_input, uint32_t input_length)
| Parse the JSON data. More...

## Function Documentation

## ◆ cy_JSON_parser_register_callback()

cy_rslt_t cy_JSON_parser_register_callback | ( | cy_JSON_callback_t | json_callback,
|  | void * | arg
| ) |  |

Register callback to be invoked by JSON parser while parsing the JSON data.

Parameters

  [in] | json_callback | : Pointer to the callback function to be invoked while parsing the JSON data
  [in] | arg | : User argument passed in when registering the callback

Returns
  cy_rslt_t

## ◆ cy_JSON_parser_get_callback()

cy_JSON_callback_t cy_JSON_parser_get_callback | ( | void |  | ) |

Returns the current callback function registered with the JSON parser.

Returns
  cy_JSON_callback_t

## ◆ cy_JSON_parser()

cy_rslt_t cy_JSON_parser | ( | const char * | json_input,
|  | uint32_t | input_length
| ) |  |

Parse the JSON data.

This function will parse the JSON input string through a single parse, calling a callback whenever it encounters milestones an object, passing in object name, JSON value type, and a value (if value is string or number )

Parameters

  [in] | json_input | : Pointer to the JSON data
  [in] | input_length | : Length of the JSON data pointed by `json_input1`

Returns
  cy_rslt_t

Note
  : Currently escape values are not supported.