utility/json_parser/main.c

/*******************************************************************************
* # License
* Copyright 2019 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
* software is governed by the terms of Silicon Labs Master Software License
* Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement. This
* software is distributed to you in Source Code format and is governed by the
* sections of the MSLA applicable to Source Code.
*
******************************************************************************/
/* Documentation for this app is available online.
* See https://docs.silabs.com/gecko-os/4/standard/latest/sdk/examples/utility/json-parser
*/
#include "gos.h"
#define APPLICATION_START_LINE "JSON Parser demo starting..."
gos_result_t parse_example1(const char *filename);
gos_result_t parse_example2(const char *filename);
gos_result_t parse_example3(const char *filename);
gos_result_t parse_example9(const char *filename);
gos_result_t parse_all_examples(void);
/*************************************************************************************************/
void gos_app_init(void)
{
gos_result_t result;
GOS_LOG(APPLICATION_START_LINE);
if (GOS_FAILED(result, parse_example1("json/example1.json")))
{
GOS_LOG("Failed to parse example1: %d", result);
}
if (GOS_FAILED(result, parse_example2("json/example2.json")))
{
GOS_LOG("Failed to parse example2: %d", result);
}
if (GOS_FAILED(result, parse_example3("json/example3.json")))
{
GOS_LOG("Failed to parse example3: %d", result);
}
if (GOS_FAILED(result, parse_example9("json/example9.json")))
{
GOS_LOG("Failed to parse example9: %d", result);
}
if (GOS_FAILED(result, parse_all_examples()))
{
GOS_LOG("Failed to parse all examples: %d", result);
}
}