Wirepas SDK
dualmcu_app/app.c
/* Copyright 2017 Wirepas Ltd. All Rights Reserved.
*
* See file LICENSE.txt for full license details.
*
*/
/*
* \file app.c
* \brief This file is a template to Dual MCU API app for all paltforms
*/
#include <stdlib.h>
#include <api.h>
#include "app_setup.h"
#include "wms_settings.h"
#ifdef DUALMCU_APP_KEY_MGMT
#include "provisioning.h"
#endif
#ifdef LOCAL_PROVISIONING
#endif
#include "dualmcu_lib.h"
void App_init(const app_global_functions_t * functions)
{
(void) functions;
#ifdef DUALMCU_APP_KEY_MGMT
if (lib_settings->getNodeRole(&role) == APP_RES_OK)
{
{
lib_settings->keyManagementConfiguration(
.flags = {
.apply_flags = 1,
.app_key_management_supported = 1,
.app_key_management_configured = 1
}
}
);
}
else
{
}
}
#endif
#ifdef LOCAL_PROVISIONING
lib_settings->getNodeRole(&role);
.timeout_s = (role & APP_LIB_SETTINGS_LL_ROLE_BIT) ? 20 : 120
};
Local_provisioning_init(NULL, NULL, &conf);
#endif
Dualmcu_lib_init(UART_BAUDRATE, UART_FLOWCONTROL);
}
app_setup_res_e App_Setup(void)
Setup configuration from application persistent memory.
dualmcu_lib_res_e Dualmcu_lib_init(uint32_t baudrate, bool flow_ctrl)
Initialize Dualmcu_lib.
Local_provisioning_res_e Local_provisioning_init(local_provisioning_psk_t *psk, local_provisioning_proxy_enabled_cb on_proxy_enabled_cb, const local_provisioning_config_t *conf)
Initialize the Local provisioning library.
Configuration for the Local provisioning library.
void Provisioning_register_csap_handlers(void)
Register the Remote API CSAP handlers for the provisioning_config attribute (0xC001) without initiali...
provisioning_ret_e Provisioning_init_from_storage(provisioning_conf_t *conf)
Initialize the provisioning process with provisioning settings from the secure storage.
This structure contains all provisioning related parameters.
@ APP_RES_OK
Definition wms_app.h:204
List of global functions, passed to App_entrypoint()
Definition wms_app.h:158
uint8_t app_lib_settings_role_t
Node role type.
@ APP_LIB_SETTINGS_ROLE_SINK_LL
@ APP_LIB_SETTINGS_ROLE_SINK_LE
#define APP_LIB_SETTINGS_LL_ROLE_BIT
LL role bit.
Structure to hold key management configuration information for the settings API.