修改枚举类名称
This commit is contained in:
@@ -31,7 +31,7 @@ int Protocol_write(const void *data, uint32_t size, uint32_t wait_ms)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Protocol_init(port_type_m port_type, void* port)
|
void Protocol_init(port_type_e port_type, void* port)
|
||||||
{
|
{
|
||||||
protocol.port.data_port = port;
|
protocol.port.data_port = port;
|
||||||
protocol.port_type = port_type;
|
protocol.port_type = port_type;
|
||||||
@@ -137,11 +137,11 @@ void Protocol_buf_decode(void* data, uint32_t size)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void protocol_set_message_status(message_status_m status)
|
void protocol_set_message_status(message_status_e status)
|
||||||
{
|
{
|
||||||
protocol.message_status = status;
|
protocol.message_status = status;
|
||||||
}
|
}
|
||||||
protocol_status_t get_protocol_status(void)
|
protocol_status_e get_protocol_status(void)
|
||||||
{
|
{
|
||||||
protocol.protocol_status = PROTOCOL_STATUS_OK;
|
protocol.protocol_status = PROTOCOL_STATUS_OK;
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,13 @@ typedef enum
|
|||||||
{
|
{
|
||||||
PORT_LINUX_UART = 0,
|
PORT_LINUX_UART = 0,
|
||||||
PORT_LINUX_SBDATA,
|
PORT_LINUX_SBDATA,
|
||||||
}port_type_m;
|
}port_type_e;
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
MESSAGE_IDLE = 0,
|
MESSAGE_IDLE = 0,
|
||||||
MESSAGE_OTA,
|
MESSAGE_OTA,
|
||||||
}message_status_m;
|
MESSAGE_FC_ISP,
|
||||||
|
}message_status_e;
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
PROTOCOL_STATUS_OK = 0,
|
PROTOCOL_STATUS_OK = 0,
|
||||||
@@ -35,20 +36,20 @@ typedef enum
|
|||||||
PROTOCOL_STATUS_TYPE_IDLE, //协议类型未知
|
PROTOCOL_STATUS_TYPE_IDLE, //协议类型未知
|
||||||
PROTOCOL_STATUS_ANALYSIS_ERROR, //长时间解析失败
|
PROTOCOL_STATUS_ANALYSIS_ERROR, //长时间解析失败
|
||||||
PROTOCOL_STATUS_IN_OTA, //OTA中
|
PROTOCOL_STATUS_IN_OTA, //OTA中
|
||||||
}protocol_status_t;
|
}protocol_status_e;
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
protocol_port_t port;
|
protocol_port_t port;
|
||||||
protocol_type_m pro_type;
|
protocol_type_m pro_type;
|
||||||
port_type_m port_type;
|
port_type_e port_type;
|
||||||
|
|
||||||
mavlink_device_t mavlink_device;
|
mavlink_device_t mavlink_device;
|
||||||
msp_port_t msp;
|
msp_port_t msp;
|
||||||
|
|
||||||
protocol_status_t protocol_status;
|
protocol_status_e protocol_status;
|
||||||
uint16_t analysis_sussess_count; //数据解析成功次数
|
uint16_t analysis_sussess_count; //数据解析成功次数
|
||||||
|
|
||||||
message_status_m message_status;
|
message_status_e message_status;
|
||||||
|
|
||||||
mavlink_message_t message;
|
mavlink_message_t message;
|
||||||
}protocol_t;
|
}protocol_t;
|
||||||
@@ -59,7 +60,7 @@ typedef struct
|
|||||||
* @param port_type 使用的设备类型(如串口或其他)
|
* @param port_type 使用的设备类型(如串口或其他)
|
||||||
* @param port 由对应的驱动提供的绑定接口获得的句柄
|
* @param port 由对应的驱动提供的绑定接口获得的句柄
|
||||||
*/
|
*/
|
||||||
void Protocol_init(port_type_m port_type, void* port);
|
void Protocol_init(port_type_e port_type, void* port);
|
||||||
/**
|
/**
|
||||||
* @brief 搜索协议
|
* @brief 搜索协议
|
||||||
*
|
*
|
||||||
@@ -90,13 +91,13 @@ void Protocol_buf_decode(void* data, uint32_t size);
|
|||||||
*
|
*
|
||||||
* @param status 消息状态
|
* @param status 消息状态
|
||||||
*/
|
*/
|
||||||
void protocol_set_message_status(message_status_m status);
|
void protocol_set_message_status(message_status_e status);
|
||||||
/**
|
/**
|
||||||
* @brief 获取协议状态
|
* @brief 获取协议状态
|
||||||
*
|
*
|
||||||
* @retval 协议状态
|
* @retval 协议状态
|
||||||
*/
|
*/
|
||||||
protocol_status_t get_protocol_status(void);
|
protocol_status_e get_protocol_status(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 飞控重启命令
|
* @brief 飞控重启命令
|
||||||
|
|||||||
Reference in New Issue
Block a user