|
|
@ -27,6 +27,7 @@ typedef enum { |
|
|
|
|
|
|
|
kifyhrs_ecode_overtime = 200, |
|
|
|
kifyhrs_ecode_channel_is_close = 201, |
|
|
|
kifyhrs_ecode_upper_exception = 202, |
|
|
|
|
|
|
|
} ify_hrs_error_code_t; |
|
|
|
|
|
|
@ -60,6 +61,8 @@ static inline const char *ify_hrs_error_code_to_string(ify_hrs_error_code_t code |
|
|
|
return "overtime"; |
|
|
|
case kifyhrs_ecode_channel_is_close: |
|
|
|
return "channel is close"; |
|
|
|
case kifyhrs_ecode_upper_exception: |
|
|
|
return "upper error"; |
|
|
|
default: |
|
|
|
return "unkown error"; |
|
|
|
} |
|
|
@ -73,7 +76,7 @@ typedef enum { |
|
|
|
} ify_hrs_packet_type_t; |
|
|
|
|
|
|
|
typedef enum { |
|
|
|
kifyhrs_sensor_pos_none = 0, // 无指定位置 |
|
|
|
kifyhrs_sensor_pos_none = 0, // 锟斤拷指锟斤拷位锟斤拷 |
|
|
|
kifyhrs_sensor_pos_I = 1, // I |
|
|
|
kifyhrs_sensor_pos_II = 2, // II |
|
|
|
kifyhrs_sensor_pos_III = 3, // III |
|
|
@ -103,10 +106,10 @@ typedef enum { |
|
|
|
ify_hrs_cmd_read_sn = 14, |
|
|
|
ify_hrs_cmd_reset = 15, |
|
|
|
ify_hrs_cmd_stop_upload_record = 16, |
|
|
|
ify_hrs_cmd_ads1293_error_detail_info = 19, // 内部使用 |
|
|
|
ify_hrs_cmd_change_sn = 20, // 内部使用 |
|
|
|
ify_hrs_cmd_read_device_exception_state = 21, // 读取设备异常状态 |
|
|
|
ify_hrs_cmd_read_ads1293_cfg_type = 22, // 读取ads1293使用的配置类型 |
|
|
|
ify_hrs_cmd_ads1293_error_detail_info = 19, // 锟节诧拷使锟斤拷 |
|
|
|
ify_hrs_cmd_change_sn = 20, // 锟节诧拷使锟斤拷 |
|
|
|
ify_hrs_cmd_read_device_exception_state = 21, // 锟斤拷取锟借备锟届常状态 |
|
|
|
ify_hrs_cmd_read_ads1293_cfg_type = 22, // 锟斤拷取ads1293使锟矫碉拷锟斤拷锟斤拷锟斤拷锟斤拷 |
|
|
|
ify_hrs_cmd_start_storage = 23, // |
|
|
|
ify_hrs_cmd_stop_storage = 24, // |
|
|
|
|
|
|
@ -136,28 +139,28 @@ typedef struct { |
|
|
|
} device_version_info_receipt_t; |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
uint8_t sensor_num; // 数量 |
|
|
|
uint8_t sensor_precision; // 精度 |
|
|
|
uint8_t sensor_sample_rate; // 采样率 |
|
|
|
uint8_t sensor0_pos; // 位置 |
|
|
|
uint8_t sensor1_pos; // 位置 |
|
|
|
uint8_t sensor2_pos; // 位置 |
|
|
|
uint8_t sensor_num; // 锟斤拷锟斤拷 |
|
|
|
uint8_t sensor_precision; // 锟斤拷锟斤拷 |
|
|
|
uint8_t sensor_sample_rate; // 锟斤拷锟斤拷锟斤拷 |
|
|
|
uint8_t sensor0_pos; // 位锟斤拷 |
|
|
|
uint8_t sensor1_pos; // 位锟斤拷 |
|
|
|
uint8_t sensor2_pos; // 位锟斤拷 |
|
|
|
} sensor_info_receipt_t; |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
uint8_t drop_state0; |
|
|
|
uint8_t drop_state1; |
|
|
|
struct { |
|
|
|
uint8_t sampling_state : 1; // 位置 |
|
|
|
uint8_t report_state : 1; // 位置 |
|
|
|
uint8_t low_battery : 1; // 位置 |
|
|
|
uint8_t full_storge : 1; // 位置 |
|
|
|
// uint8_t is_storaging : 1; // 位置 |
|
|
|
uint8_t holder : 4; // 位置 |
|
|
|
uint8_t sampling_state : 1; // 位锟斤拷 |
|
|
|
uint8_t report_state : 1; // 位锟斤拷 |
|
|
|
uint8_t low_battery : 1; // 位锟斤拷 |
|
|
|
uint8_t full_storge : 1; // 位锟斤拷 |
|
|
|
// uint8_t is_storaging : 1; // 位锟斤拷 |
|
|
|
uint8_t holder : 4; // 位锟斤拷 |
|
|
|
} device_state0; |
|
|
|
uint8_t device_state1; // 预留 |
|
|
|
uint8_t powerlevel; // 电量 |
|
|
|
uint8_t storage_item_num; // 记录存储条数 |
|
|
|
uint8_t device_state1; // 预锟斤拷 |
|
|
|
uint8_t powerlevel; // 锟斤拷锟斤拷 |
|
|
|
uint8_t storage_item_num; // 锟斤拷录锟芥储锟斤拷锟斤拷 |
|
|
|
// uint32_t storage_setting_time_s; |
|
|
|
// uint32_t storage_has_storaged_time_s; |
|
|
|
} device_state_receipt_t; |
|
|
@ -190,7 +193,7 @@ typedef struct { |
|
|
|
} start_capture_cmd_t; |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
uint8_t record_index; // 最近第几条记录 |
|
|
|
uint8_t record_index; // 锟斤拷锟斤拷诩锟斤拷锟斤拷锟铰� |
|
|
|
} read_record_info_cmd_t; |
|
|
|
|
|
|
|
typedef struct { |
|
|
@ -200,8 +203,8 @@ typedef struct { |
|
|
|
uint8_t sensorNum; |
|
|
|
uint8_t captureRate; // N*10HZ |
|
|
|
uint8_t capturePrecision; |
|
|
|
uint8_t compressAlgorithm; // 压缩算法 |
|
|
|
uint32_t checksum; // 校验和 |
|
|
|
uint8_t compressAlgorithm; // 压锟斤拷锟姐法 |
|
|
|
uint32_t checksum; // 校锟斤拷锟� |
|
|
|
} read_record_info_receipt_t; |
|
|
|
|
|
|
|
typedef struct { |
|
|
@ -221,7 +224,7 @@ typedef struct { |
|
|
|
} error_receipt_t; |
|
|
|
|
|
|
|
/******************************************************************************* |
|
|
|
* 上报相关结构体 * |
|
|
|
* 锟较憋拷锟斤拷亟峁癸拷锟� * |
|
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
typedef struct { |
|
|
@ -230,7 +233,7 @@ typedef struct { |
|
|
|
uint8_t cmd; |
|
|
|
|
|
|
|
uint32_t sample_data_index; |
|
|
|
uint8_t data[]; // 上报的数据 |
|
|
|
uint8_t data[]; // 锟较憋拷锟斤拷锟斤拷锟斤拷 |
|
|
|
} heartrate_report_packet_t; |
|
|
|
|
|
|
|
typedef struct { |
|
|
|