Files
kunlun/app/smart_grid/inc/internal/iot_sg_cco_cli.h

112 lines
3.1 KiB
C
Raw Normal View History

2024-09-28 14:24:04 +08:00
/****************************************************************************
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_SG_CCO_CLI_H
#define IOT_SG_CCO_CLI_H
/* os shim includes */
#include "os_types_api.h"
/* smart grid internal header files */
#include "iot_sg_fr.h"
#ifdef __cplusplus
extern "C" {
#endif
#if IOT_SMART_GRID_CLI_ENABLE
/**
* @brief: cli init read meter age.
* @param read_meter_timeout: secondary node monitor timeout limit in second.
*/
void iot_sg_cco_init_age_cli(uint16_t read_meter_timeout);
/**
* @brief: reoprt config msg to cli host interface.
*/
void iot_sg_cco_cli_rpt_config_info();
/**
* @brief: cli report stop sec node register.
* @param reason: see ERR_XXX.
*/
void iot_sg_cco_cli_rpt_stop_sec_node(uint32_t reason);
/**
* @brief: cli report sec node done.
*/
void iot_sg_cco_cli_rpt_sec_node_done();
/**
* @brief: cli report event data.
* @param dev_type: device type, see IOT_SG_CCO_DEV_TYPE_XXX.
* @param proto_type: proto type of the event reporting data.
* @param evt_type: event type, see IOT_SG_CCO_EVENT_XXX.
* @param data_len: data len.
* @param data: event data.
*/
void iot_sg_cco_cli_evt_data(uint8_t dev_type, uint8_t proto_type,
uint8_t evt_type, uint16_t data_len, uint8_t *data);
/**
* @brief: handle cli message.
*/
void iot_sg_cco_handle_cli_msg(iot_sg_msg_t *sg_msg);
/**
* @brief: report stop route read meter to cli.
*/
void iot_sg_cco_cli_request_stop_rt_mr();
/**
* @brief: response local proto data to cli.
* @param pkt: response proto that send to cli,
* the ownership of the pkt will be transferred.
*/
void iot_sg_cco_cli_response_local_proto_data(iot_pkt_t *pkt);
/**
* @brief: callback to receive event from cli host.
* @param param: callback function parameter.
* @param pkt: pointer to iot_pkt_t structure.
*/
void iot_sg_cco_cli_callback(void *param, iot_pkt_t *pkt);
#else /* IOT_SMART_GRID_CLI_ENABLE */
#define iot_sg_cco_init_age_cli(read_meter_timeout)
#define iot_sg_cco_cli_rpt_config_info()
#define iot_sg_cco_cli_rpt_stop_sec_node(reason)
#define iot_sg_cco_cli_rpt_sec_node_done()
#define iot_sg_cco_cli_evt_data(dev_type, proto_type, evt_type, data_len, data)
#define iot_sg_cco_handle_cli_msg(sg_msg)
#define iot_sg_cco_cli_request_stop_rt_mr()
#define iot_sg_cco_cli_callback(param, pkt)
#endif /* IOT_SMART_GRID_CLI_ENABLE */
#ifdef __cplusplus
}
#endif
#endif /* IOT_SG_CCO_CLI_H */