network/ethernet_bridge/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/intro/hello-world
*/
#include "gos.h"
#define STARTUP_SETTINGS_MAGIC_NUMBER 0x00010000 // version 1.0.0
#define APPLICATION_START_LINE "\r\n\r\nEthernet bridge demo"
/*************************************************************************************************/
void gos_app_init(void)
{
gos_result_t result;
if (GOS_FAILED(result, gos_load_app_settings_once("settings.ini", STARTUP_SETTINGS_MAGIC_NUMBER)))
{
GOS_LOG("Failed to load 'settings.ini', error: %d", result);
}
// Print to the log bus
GOS_LOG(APPLICATION_START_LINE);
config.src = NULL;
config.dst = NULL;
config.len = 0;
config.callback = NULL;
config.wait_timeout_ms = 10000;
config.logs_enabled = true;
if (GOS_FAILED(result, gos_cmd_issue_with_config(&config, "bridge_start")))
{
GOS_LOG("Failed to issue 'bridge_start' command, error: %d", result);
}
}
/*************************************************************************************************/
void gos_app_deinit(void)
{
// This API is called just before the application finishes.
// Anything initialized or allocated by the app should be cleaned here.
// This API is optional.
}
/*************************************************************************************************/
void gos_app_idle(void)
{
// This is called when the event thread has no more pending events.
}