uav_low_speed_data_channel.h
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef __UAV_LOW_SPEED_DATA_CHANNEL_H__
#define __UAV_LOW_SPEED_DATA_CHANNEL_H__
#include <stdint.h>
#include "uav_core.h"
#include "uav_typedef.h"
#ifdef __cplusplus
extern "C" {
#endif
enum E_UAVChannelID{
UAV_CHANNEL_ADDRESS_UNKNOW = 0,
UAV_CHANNEL_ADDRESS_MASTER_RC_APP = 1,
UAV_CHANNEL_ADDRESS_CLOUD_API = 2,
UAV_CHANNEL_ADDRESS_SLAVE_RC_APP = 3,
};
typedef void (*UAV_LowSpeedDataChannelRecvDataCallback)(int32_t srcChannelID, int data_type, const uint8_t *data, uint32_t len);
/**
* @brief Initialize the low speed data channel
* @note The interface initialization needs to be after UAV_Core_Init.
* @return 0: success, others: failed
*/
T_UAVReturnCode UAV_LowSpeedDataChannel_Init(void);
/**
* @brief Deinitialize the low speed data channel
*/
void UAV_LowSpeedDataChannel_DeInit(void);
/**
* @brief Send custom data to the specified channel
* @param dstChannelID The destination channel ID
* @param data_type The type of data
* @param data The data to be sent
* @param len The length of the data
* @return 0: success, others: failed
*/
T_UAVReturnCode UAV_LowSpeedDataChannel_SendData(int32_t dstChannelID, int data_type, const uint8_t *data, uint32_t len);
/**
* @brief Register callback function used to receive data from selected channel
* @param callback The callback function
* @return 0: success, others: failed
*/
T_UAVReturnCode UAV_LowSpeedDataChannel_RegRecvDataCallback(UAV_LowSpeedDataChannelRecvDataCallback callback);
#ifdef __cplusplus
}
#endif
#endif // __UAV_LOW_SPEED_DATA_CHANNEL_H__