初始提交
This commit is contained in:
107
export/inc/app/iot_app_api.h
Executable file
107
export/inc/app/iot_app_api.h
Executable file
@@ -0,0 +1,107 @@
|
||||
/****************************************************************************
|
||||
|
||||
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
||||
|
||||
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
||||
be copied by any method or incorporated into another program without
|
||||
the express written consent of Aerospace C.Power. This Information or any portion
|
||||
thereof remains the property of Aerospace C.Power. The Information contained herein
|
||||
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
||||
liability for its use in any way and conveys no license or title under
|
||||
any patent or copyright and makes no representation or warranty that this
|
||||
Information is free from patent or copyright infringement.
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef IOT_APP_API_H
|
||||
#define IOT_APP_API_H
|
||||
|
||||
#include "iot_plc_api.h"
|
||||
#include "iot_errno_api.h"
|
||||
#include "iot_version_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** \defgroup APP_APIs APP APIs
|
||||
* @brief WQ30x1 APP APIs
|
||||
*
|
||||
* APIs for customer application(s) to register their entry main function.
|
||||
* MAX 3 customer appliccations can be added
|
||||
*/
|
||||
|
||||
/** @addtogroup APP_APIs
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
/* below IDs are defined in spec, and should not be changed */
|
||||
IOT_PLC_APP_SMART_GRID = IOT_PLC_APP_ID_MIN,
|
||||
IOT_PLC_IP_ID,
|
||||
IOT_PLC_TEST_FRAME_ID,
|
||||
IOT_PLC_ETHERNET_ID,
|
||||
IOT_PLC_SILA_NHM_ID = 53,
|
||||
/* below IDs are vendor specific extension */
|
||||
IOT_PLC_APP_HOST_INTERFACE = IOT_PLC_APP_ID_VENDOR_MIN,
|
||||
IOT_PING_APP_ID,
|
||||
IOT_PLCUART_APP_ID,
|
||||
IOT_PLC_APP_DEMO_ID,
|
||||
IOT_GR_APP_ID,
|
||||
IOT_PLC_APP_DEV_TEST,
|
||||
IOT_TPUT_APP_ID,
|
||||
IOT_BRM_APP_ID,
|
||||
IOT_SUNSOLAR_APP_ID,
|
||||
IOT_TK_APP_ID,
|
||||
IOT_PLC_APP_MAX = IOT_TK_APP_ID
|
||||
} iot_app_id_t;
|
||||
|
||||
/**
|
||||
* @brief iot_plc_entry() - entry point to bring up the whole plc stack.
|
||||
* after whole plc stack is up, app entries will be called in the sequence
|
||||
* they are added. Note that this function returns nonzero for a failed case,
|
||||
* and doesn't return any value for a successful case.
|
||||
* @param info: build info of the binary
|
||||
*
|
||||
* @return nonzero -- OS boot failur, mostly cfg not right
|
||||
*/
|
||||
uint32_t iot_plc_entry(iot_build_info_t *info);
|
||||
|
||||
/**
|
||||
* @brief (*iot_app_entry_func_t)() - declaration for app entry method.
|
||||
*
|
||||
* @return ERR_PENDING -- if application want to delay the plc network formation.
|
||||
* otherwise -- plc network formation will be started automatically.
|
||||
*/
|
||||
typedef uint32_t (*iot_app_entry_func_t)();
|
||||
|
||||
/**
|
||||
* @brief iot_app_add_entry() - add app entry. the app entry will be called
|
||||
* after the whole plc stack is up. customer can create their own task in
|
||||
* app entry function.
|
||||
* @param entry: app entry method to be added
|
||||
*
|
||||
* @return 0 -- for success case
|
||||
* @return otherwise -- for failure case
|
||||
*/
|
||||
uint32_t iot_app_add_entry(iot_app_entry_func_t entry);
|
||||
|
||||
/**
|
||||
* @brief iot_app_plc_core_start() - to load plc-core app used by cus-core.
|
||||
* @param entry:
|
||||
*
|
||||
* @return 0 -- for success case
|
||||
* @return otherwise -- for failure case
|
||||
*/
|
||||
int iot_app_plc_core_start();
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* IOT_APP_API_H */
|
Reference in New Issue
Block a user