92 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			92 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
| /****************************************************************************
 | |
| 
 | |
| 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_EXT_H_
 | |
| #define _IOT_SG_EXT_H_
 | |
| 
 | |
| /* os shim includes */
 | |
| #include "os_types_api.h"
 | |
| 
 | |
| /* common includes */
 | |
| #include "iot_config_api.h"
 | |
| #include "iot_sg_ext_api.h"
 | |
| #include "iot_sg_msg.h"
 | |
| #include "iot_plc_msg_api.h"
 | |
| 
 | |
| #ifdef __cplusplus
 | |
| extern "C" {
 | |
| #endif
 | |
| 
 | |
| /**
 | |
|  * @brief iot_sg_ext_cusuart_config() - Config uart port that cus-app used.
 | |
|  *   This post a message to cus-app.
 | |
|  * @param brate: baudrate
 | |
|  * @param parity: see IOT_UART_PARITY_XXX
 | |
|  * @param data: data bits
 | |
|  * @param stop: stop flag
 | |
|  * @param p_frame_fmt: the format structure of the frame
 | |
|  * @param thd_rx_tm: threshold for receive timeout.
 | |
|  *   IOT_SG_EXT_INVALID_TIMEOUT means ignore this.
 | |
|  * @param thd_rx_ful: threshold for receive fifo full.
 | |
|  *   IOT_SG_EXT_INVALID_TIMEOUT means ignore this.
 | |
|  * @return: ERR_OK - configuration successful.
 | |
|  *   ERR_FAIL - configuration failed.
 | |
|  */
 | |
| uint32_t iot_sg_ext_cusuart_config(uint32_t brate, uint8_t parity, uint8_t data,
 | |
|     uint8_t stop, iot_frame_fmt *fmt, uint32_t thd_rx_tm, uint32_t thd_rx_ful);
 | |
| 
 | |
| /**
 | |
|  * @brief iot_sg_ext_send_to_cusapp() - Send data to cusapp.
 | |
|  * @param p_pkt: packet for sending. p_pkt will be freed always.
 | |
|  * @param arg:   arg for cus-app.
 | |
|  * @return: ERR_OK - send successful.
 | |
|  *   ERR_FAIL - send failed.
 | |
|  */
 | |
| uint32_t iot_sg_ext_send_to_cusapp(iot_pkt_t *p_pkt, uint8_t arg);
 | |
| 
 | |
| /**
 | |
|  * @brief iot_sg_ext_app_init() - extend sgapp initializing function called.
 | |
|  *   from iot_sg_ext_init().
 | |
|  * @return: ERR_OK - initialization successful.
 | |
|  *   ERR_FAIL - initialization failed.
 | |
|  */
 | |
| uint32_t iot_sg_ext_app_init(void);
 | |
| 
 | |
| /**
 | |
|  * @brief iot_sg_ext_ipc_send() - Send ipc message to cus-app.
 | |
|  * @param p_pkt: packet for sending to cus-app.
 | |
|  */
 | |
| void iot_sg_ext_ipc_send(iot_pkt_t *p_pkt);
 | |
| 
 | |
| /**
 | |
|  * @brief iot_sg_ext_send_msdu_msg_to_cus() - send msdu data to customer app.
 | |
|  * @param pkt: data contain of msdu data.
 | |
|  * @param msdu: msdu data.
 | |
|  */
 | |
| void iot_sg_ext_send_msdu_msg_to_cus(iot_pkt_t *pkt,
 | |
|     iot_plc_msdu_recv_t *msdu);
 | |
| 
 | |
| /**
 | |
|  * @brief   iot_sg_enable_cus_msdu_fwd() - enable cusapp msdu handle
 | |
|  * @param:  if enable cusapp msdu handle
 | |
|  */
 | |
| void iot_sg_enable_cus_msdu_fwd(uint8_t enable);
 | |
| 
 | |
| #ifdef __cplusplus
 | |
| }
 | |
| #endif
 | |
| 
 | |
| #endif /* _IOT_SG_EXT_H_ */
 |