79 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			79 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
|  | /****************************************************************************
 | ||
|  | 
 | ||
|  | 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_CLI_PLC_TX_RX_H
 | ||
|  | #define IOT_CLI_PLC_TX_RX_H
 | ||
|  | 
 | ||
|  | #include "iot_pkt_api.h"
 | ||
|  | 
 | ||
|  | #include "iot_cli_tx_rx.h"
 | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | extern "C" { | ||
|  | #endif
 | ||
|  | 
 | ||
|  | #pragma pack(push)  /* save the pack status */
 | ||
|  | #pragma pack(1)     /* 1 byte align */
 | ||
|  | 
 | ||
|  | void cli_ul_send_with_retry(uint32_t msgid, uint8_t *buffer, | ||
|  |     uint32_t length, uint8_t *dst_mac); | ||
|  | void iot_cli_plc_recv(void *param, iot_pkt_t *pkt); | ||
|  | /**
 | ||
|  | * @brief iot_cli_create_pkt_plc - send data via plc network | ||
|  | * @param send_type:        send type | ||
|  | * @param retry_cnt:        retry cnt | ||
|  | * @param msgid:            message id | ||
|  | * @param src_mac:          src mac | ||
|  | * @param cli_dest_mac:     cli msg dealwith destination node mac | ||
|  | * @param plc_dest_mac:     plc trans to destination node mac | ||
|  | * @param data_len:         buffer len | ||
|  | * | ||
|  | * @retval:                 packet pointer | ||
|  | */ | ||
|  | iot_pkt_t * iot_cli_create_pkt_plc(uint8_t send_type, uint8_t retry_cnt, | ||
|  |     uint16_t moduleid, uint32_t msgid, uint8_t *src_mac, | ||
|  |     uint8_t *cli_dest_mac, uint8_t *plc_dest_mac, uint32_t data_len); | ||
|  | 
 | ||
|  | /**
 | ||
|  | * @brief iot_cli_host_create_pkt_plc - send data via plc network | ||
|  | * @param send_type:        send type | ||
|  | * @param retry_cnt:        retry cnt | ||
|  | * @param msgid:            message id | ||
|  | * @param src_mac:          src mac | ||
|  | * @param dest_mac:         destination mac | ||
|  | * @param buf:              data buffer | ||
|  | * @param data_len:         buffer len | ||
|  | */ | ||
|  | void iot_cli_module_send_data_with_retry(uint8_t send_type, | ||
|  |     uint8_t retry_cnt, uint16_t moduleid, uint32_t msgid, uint8_t *src_mac, | ||
|  |     uint8_t *dest_mac, uint8_t *buf, uint32_t len); | ||
|  | 
 | ||
|  | /**
 | ||
|  | * @brief iot_cli_host_send_data_plc - send data via plc network | ||
|  | * @param send_type:        send type | ||
|  | * @param msgid:            message id | ||
|  | * @param dest_mac:         destination mac | ||
|  | * @param buf:              send buffer | ||
|  | * @param len:              send buffer len | ||
|  | */ | ||
|  | void iot_cli_host_send_data_plc(uint8_t send_type, uint32_t msgid, | ||
|  |     uint8_t *dest_mac, uint8_t *buf, uint32_t len); | ||
|  | 
 | ||
|  | #pragma pack(pop)   /* restore the pack status */
 | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | } | ||
|  | #endif
 | ||
|  | 
 | ||
|  | #endif
 |