You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
1.3 KiB

#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define adwin_config_protocol_size sizeof(adwin_config_protocol_t)
#define reported_data_size sizeof(reported_data_t)
#pragma pack(push, 1)
typedef struct
{
uint32_t fixed_bit_1; /* 固定位1:F0 00 20 00 */
uint32_t time_stamp_s; /* 相对时间戳,上位机通知Xsync开始工作时,从0开始,每秒+1 */
uint32_t fixed_bit_2; /* 固定位2:00 00 B0 42 */
uint32_t server_version; /* server版本号 */
uint32_t xilinx_version; /* Xilinx Version,看需求中固定为:41 61 F7 FF */
uint8_t mac_address[6]; /* MAC地址 */
uint16_t fixed_bit_3; /* 固定位3:00 00 */
uint16_t fixed_bit_4; /* 固定位4:00 00 */
uint8_t dhcp_enable; /* DHCP enable :0-False 1- TRUE */
uint8_t netmask_count; /* netmask COUNT */
uint32_t gateway_ip; /* 网关 */
uint64_t fixed_bit_5; /* 固定位5:00 00 00 00 00 00 00 00 */
uint64_t fixed_bit_6; /* 固定位6:00 00 00 00 00 00 00 00 */
} adwin_config_protocol_t;
typedef struct
{
uint32_t time_stamp_s; /* 时间戳 */
int32_t encoder_1_count; /* 编码器1计数 */
int32_t encoder_2_count; /* 编码器2计数 */
uint32_t device_id; /* 设备ID号 */
} reported_data_t;
#pragma pack(pop)