初始提交
This commit is contained in:
79
export/inc/cli/iot_cli_tput_api.h
Executable file
79
export/inc/cli/iot_cli_tput_api.h
Executable file
@@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
|
||||
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_TPUT_API_H__
|
||||
#define __IOT_CLI_TPUT_API_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define IOT_CLI_SG_MSG_TEST_TPUT (0x1)
|
||||
|
||||
#define IOT_CLI_TPUT_REQ (0x1)
|
||||
|
||||
#pragma pack(push) // save the pack status
|
||||
#pragma pack(1) // 1 byte align
|
||||
|
||||
/** cli and tput transfer data msg header */
|
||||
typedef struct _iot_cli_tput_msg_header {
|
||||
/** msg id */
|
||||
uint8_t msg_id;
|
||||
/** request id */
|
||||
uint8_t req_id;
|
||||
/** reserved for future */
|
||||
uint16_t reserved;
|
||||
} iot_cli_tput_msg_header_t;
|
||||
|
||||
typedef struct _iot_cli_tput_report {
|
||||
uint32_t test_id;
|
||||
uint32_t tput_valu; //kpbs
|
||||
uint8_t down_or_up_link;
|
||||
uint8_t dst[6];
|
||||
}iot_cli_tput_report_t;
|
||||
|
||||
/**
|
||||
* @brief (*iot_cli_tput_recv_func_t)() - callback to receive event from
|
||||
* cli host.
|
||||
* @param param: parameter registered in iot_cli_tput_interface_register
|
||||
* @param pkt: buffer to store the event detail, application should call
|
||||
* iot_free_pkt function ASAP to free the iot_pkt_t. it's very
|
||||
* scarce resource.
|
||||
*/
|
||||
typedef void(*iot_cli_tput_recv_func_t)(void *param, iot_pkt_t *pkt);
|
||||
|
||||
typedef struct _iot_cli_tput_interface {
|
||||
/** callback to receive event from cli host */
|
||||
iot_cli_tput_recv_func_t recv;
|
||||
/** parameter that will be transferred back alone with the callback */
|
||||
void *param;
|
||||
} iot_cli_tput_interface_t;
|
||||
|
||||
#pragma pack(pop) // restore the pack status
|
||||
|
||||
#if IOT_TPUT_APP_ENABLE
|
||||
uint32_t iot_cli_tput_interface_register(iot_cli_tput_interface_t \
|
||||
*cli_interface);
|
||||
|
||||
void iot_cli_tput_send_data_to_cli_interface(iot_pkt_t *pkt);
|
||||
|
||||
void iot_cli_tput_handle_msg(iot_pkt_t *pkt);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user