|
@ -5,9 +5,11 @@ |
|
|
#include <stdlib.h> |
|
|
#include <stdlib.h> |
|
|
|
|
|
|
|
|
#define adwin_config_protocol_size sizeof(adwin_config_protocol_t) |
|
|
#define adwin_config_protocol_size sizeof(adwin_config_protocol_t) |
|
|
#define reported_data_size sizeof(reported_data_t) |
|
|
|
|
|
|
|
|
#define active_report_data_size sizeof(active_report_data_t) |
|
|
|
|
|
#define basic_report_data_size sizeof(basic_report_data_t) |
|
|
|
|
|
|
|
|
#pragma pack(push, 1) |
|
|
#pragma pack(push, 1) |
|
|
|
|
|
|
|
|
typedef struct |
|
|
typedef struct |
|
|
{ |
|
|
{ |
|
|
uint32_t fixed_bit_1; /* 固定位1:F0 00 20 00 */ |
|
|
uint32_t fixed_bit_1; /* 固定位1:F0 00 20 00 */ |
|
@ -27,10 +29,37 @@ typedef struct |
|
|
|
|
|
|
|
|
typedef struct |
|
|
typedef struct |
|
|
{ |
|
|
{ |
|
|
|
|
|
uint16_t index; /* */ |
|
|
|
|
|
uint16_t cmd_id; /* 指令id */ |
|
|
uint32_t time_stamp_s; /* 时间戳 */ |
|
|
uint32_t time_stamp_s; /* 时间戳 */ |
|
|
int32_t encoder_1_count; /* 编码器1计数 */ |
|
|
int32_t encoder_1_count; /* 编码器1计数 */ |
|
|
int32_t encoder_2_count; /* 编码器2计数 */ |
|
|
int32_t encoder_2_count; /* 编码器2计数 */ |
|
|
uint32_t device_id; /* 设备ID号 */ |
|
|
|
|
|
} reported_data_t; |
|
|
|
|
|
|
|
|
uint8_t device_id; /* 设备ID号 */ |
|
|
|
|
|
uint8_t checksum; /* 校验和 */ |
|
|
|
|
|
} active_report_data_t; |
|
|
|
|
|
|
|
|
|
|
|
typedef struct |
|
|
|
|
|
{ |
|
|
|
|
|
uint16_t index; /* */ |
|
|
|
|
|
uint16_t cmd_id; /* 指令id */ |
|
|
|
|
|
uint16_t data; /* 数据 */ |
|
|
|
|
|
uint8_t checksum; /* 校验和 */ |
|
|
|
|
|
} basic_report_data_t; |
|
|
|
|
|
|
|
|
|
|
|
typedef struct |
|
|
|
|
|
{ |
|
|
|
|
|
uint16_t index; /* */ |
|
|
|
|
|
uint16_t cmd_id; /* 指令id */ |
|
|
|
|
|
uint8_t checksum; /* 校验和 */ |
|
|
|
|
|
} get_encoder_report_t; |
|
|
|
|
|
|
|
|
|
|
|
typedef struct |
|
|
|
|
|
{ |
|
|
|
|
|
uint16_t index; /* */ |
|
|
|
|
|
uint16_t cmd_id; /* 指令id */ |
|
|
|
|
|
uint32_t encoder1; /* 编码器1的数据 */ |
|
|
|
|
|
uint32_t encoder2; /* 编码器2的数据 */ |
|
|
|
|
|
uint8_t checksum; /* 校验和 */ |
|
|
|
|
|
} get_encoder_respont_t; |
|
|
|
|
|
|
|
|
#pragma pack(pop) |
|
|
#pragma pack(pop) |