diff --git a/heart_rate_sensor_protocol.h b/heart_rate_sensor_protocol.h index c5f99c8..46126d5 100644 --- a/heart_rate_sensor_protocol.h +++ b/heart_rate_sensor_protocol.h @@ -22,6 +22,8 @@ typedef enum { kifyhrs_ecode_no_record_find = 7, kifyhrs_ecode_parameter_error = 8, kifyhrs_ecode_electrode_is_not_inserted = 9, + kifyhrs_ecode_device_exception = 10, + kifyhrs_ecode_invalid_state = 11, } ify_hrs_error_code_t; typedef enum { @@ -48,24 +50,26 @@ typedef enum { } ify_hrs_sensor_pos_t; typedef enum { - ify_hrs_cmd_read_device_version = 1, - ify_hrs_cmd_read_sensor_info = 2, - ify_hrs_cmd_read_device_state = 3, - ify_hrs_cmd_read_time = 4, - ify_hrs_cmd_sync_time = 5, - ify_hrs_cmd_start_capture = 6, - ify_hrs_cmd_stop_capture = 7, - ify_hrs_cmd_start_realtime_report = 8, - ify_hrs_cmd_stop_realtime_report = 9, - ify_hrs_cmd_read_records_info = 10, - ify_hrs_cmd_del_record = 11, - ify_hrs_cmd_start_upload_record = 12, - ify_hrs_cmd_enter_ota = 13, - ify_hrs_cmd_read_sn = 14, - ify_hrs_cmd_reset = 15, - ify_hrs_cmd_stop_upload_record = 16, - ify_hrs_cmd_start_capture_time_v2 = 17, - ify_hrs_cmd_start_upload_record_v2 = 18, + ify_hrs_cmd_read_device_version = 1, + ify_hrs_cmd_read_sensor_info = 2, + ify_hrs_cmd_read_device_state = 3, + ify_hrs_cmd_read_time = 4, + ify_hrs_cmd_sync_time = 5, + ify_hrs_cmd_start_realtime_preview = 8, + ify_hrs_cmd_stop_realtime_preview = 9, + ify_hrs_cmd_read_records_info = 10, + ify_hrs_cmd_del_record = 11, + ify_hrs_cmd_start_upload_record = 12, + ify_hrs_cmd_enter_ota = 13, + 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_start_storage = 23, // + ify_hrs_cmd_stop_storage = 24, // ify_hrs_report_heartrate_data = 101, ify_hrs_report_battery_level = 102, @@ -104,11 +108,14 @@ typedef struct { 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; typedef struct {