utility/json_parser/main.c

/*
* EVALUATION AND USE OF THIS SOFTWARE IS SUBJECT TO THE TERMS AND
* CONDITIONS OF THE CONTROLLING LICENSE AGREEMENT FOUND AT LICENSE.md
* IN THIS SDK. IF YOU DO NOT AGREE TO THE LICENSE TERMS AND CONDITIONS,
* PLEASE RETURN ALL SOURCE FILES TO SILICON LABORATORIES.
* (c) Copyright 2018, Silicon Laboratories Inc. All rights reserved.
*/
/* 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);
}
}