/**************************************************************************** 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 CVG_APP_SPG_H #define CVG_APP_SPG_H /* os shim includes */ #include "os_types.h" /* cvg layer includes */ #include "iot_plc_msg_api.h" #ifdef __cplusplus extern "C" { #endif #if SUPPORT_SOUTHERN_POWER_GRID /** * @brief handle send msdu reqest from app layer this method support both * CCO & STA/PCO role. * * @param pkt: the pkt which app wants to send * @param req: meta info about the request * * @return * 1 - packet send out * 0 - packet dropped */ uint8_t cvg_app_handle_send_msdu_req_spg(iot_pkt_t *pkt, iot_plc_msdu_send_t* req); /** * @brief cvg_app_report_msdu_to_app_spg() - report msdu to app layer * @param buf: buf containing msdu packet * @param mac: mac header of the msdu * @param app_id: application id of the msdu */ void cvg_app_report_msdu_to_app_spg(iot_pkt_t *buf, spg_mac_header_t *mac, uint8_t app_id); /** * @brief cvg_app_handle_conn_less_send_msdu_req_spg() - handle send conn less * data reqest from app layer this method support both CCO & STA/PCO role. * @param pkt: the pkt which app wants to send * @param req: meta info about the request * @retval 1: packet send out * @retval 0: packet dropped */ uint8_t cvg_app_handle_conn_less_send_msdu_req_spg(iot_pkt_t *pkt, iot_plc_msdu_send_t *req); /** * @brief cvg_app_report_msdu_capture_to_app_spg() - report captured msdu to * app layer * @param mac: mac header of the msdu * @param data: app data of the msdu * @param len: app data len of the msdu * @param app_id: application id of the msdu */ void cvg_app_report_msdu_capture_to_app_spg(spg_mac_header_t *mac, uint8_t *data, uint32_t len, uint8_t app_id); /** * @brief cvg_app_handle_ctrl_proto_send_req_spg() - handling the MSDU sending * of the controller protocol for spg. * @param pkt: the pkt which app wants to send * @param req: meta info about the request * @retval: 1 - packet send out, 0 - packet dropped */ uint8_t cvg_app_handle_ctrl_proto_send_req_spg(iot_pkt_t *pkt, iot_plc_msdu_send_t *req); #if HPLC_RF_DEV_SUPPORT /* @brief report single hop msdu to app layer * @param buf: buf containing msdu packet * @param s_mac: mac header of the msdu * @param app_id application id of this msdu * @param stei: source tei come from fc * @param dtei: destination tei come from fc * @param is_bcast: flag to mark if this packet is broadcast packet */ void cvg_app_report_single_hop_msdu_to_app_spg(iot_pkt_t *buf, spg_mac_short_header_t *s_mac, uint8_t app_id, tei_t stei, tei_t dtei, uint8_t is_bcast); #else /* HPLC_RF_DEV_SUPPORT */ #define cvg_app_report_single_hop_msdu_to_app_spg(buf, s_mac, app_id, stei, \ dtei, is_bcast) #endif /* HPLC_RF_DEV_SUPPORT */ #else #define cvg_app_handle_send_msdu_req_spg(pkt, req) (0) #define cvg_app_report_msdu_to_app_spg(buf, mac, app_id) #define cvg_app_handle_conn_less_send_msdu_req_spg(buf, req) (0) #define cvg_app_report_msdu_capture_to_app_spg(mac, data, len, app_id) #define cvg_app_handle_ctrl_proto_send_req_spg(pkt, req) (0) #define cvg_app_report_single_hop_msdu_to_app_spg(buf, s_mac, app_id, stei, \ dtei, is_bcast) #endif #ifdef __cplusplus } #endif #endif /* CVG_APP_SPG_H */