|
|
@ -1,15 +1,15 @@ |
|
|
|
#include "ble_cmd_process_service.h" |
|
|
|
|
|
|
|
#include "../../ify_hrs_protocol/heart_rate_sensor_protocol.h" |
|
|
|
#include "basic/device_version_info_mgr.h" |
|
|
|
#include "board/board.h" |
|
|
|
#include "board/board_battery_state.h" |
|
|
|
#include "board/board_ecg_sensor.h" |
|
|
|
#include "config.h" |
|
|
|
#include "one_conduction_board.h" |
|
|
|
#include "sample_data_manager.h" |
|
|
|
#include "zble_module.h" |
|
|
|
#include "zdatachannel_service.h" |
|
|
|
#include "basic/device_version_info_mgr.h" |
|
|
|
#include "board/board_ecg_sensor.h" |
|
|
|
#include "board/board_battery_state.h" |
|
|
|
|
|
|
|
APP_TIMER_DEF(m_record_upload_tmr); // 数据上报定时器 |
|
|
|
APP_TIMER_DEF(m_record_upload_finish_packet_report_tmr); // 数据上报完成上报定时器 |
|
|
@ -58,7 +58,7 @@ int ble_stop_realtime_report() { |
|
|
|
m_realtime_report_state = false; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
void ble_cmder_try_report_one_sample_data(uint32_t frameIndex, uint16_t data0, uint16_t data1, uint16_t data2, uint16_t data3,uint16_t data4) { |
|
|
|
void ble_cmder_try_report_one_sample_data(uint32_t frameIndex, uint16_t data0, uint16_t data1, uint16_t data2, uint16_t data3, uint16_t data4) { |
|
|
|
if (!m_realtime_report_state) { |
|
|
|
return; |
|
|
|
} |
|
|
@ -216,6 +216,12 @@ int ble_start_upload_record(sample_data_filename_t* recordid) { |
|
|
|
int ble_stop_upload_record() { |
|
|
|
m_isupload_data_state = false; |
|
|
|
app_timer_stop(m_record_upload_tmr); |
|
|
|
|
|
|
|
if (m_upload_fd > 0) { |
|
|
|
sample_data_mgr_close(m_upload_fd); |
|
|
|
m_upload_fd = 0; |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
bool ble_is_upload_record() { return m_isupload_data_state; } |
|
|
@ -231,9 +237,7 @@ static void send_error_receipt(ify_hrs_packet_t* rxpacket, int32_t errorcode) { |
|
|
|
txheader->cmd = rxpacket->cmd; |
|
|
|
txheader->frame_index = rxpacket->frame_index; |
|
|
|
txheader->frame_type = kifyhrs_pt_error_receipt; |
|
|
|
|
|
|
|
txheader->frame_type = kifyhrs_pt_error_receipt; |
|
|
|
receipt->errorcode = kifyhrs_ecode_cmd_not_support; |
|
|
|
receipt->errorcode = errorcode; |
|
|
|
zdatachannel_data_send2(txbuf, sendlen); |
|
|
|
} |
|
|
|
|
|
|
@ -417,7 +421,7 @@ void ble_cmder_process_rx(uint8_t* rx, int len) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if (cmd == ify_hrs_cmd_start_upload_record) { // 12 0x0C |
|
|
|
else if (cmd == ify_hrs_cmd_start_upload_record) { // 12 0x0C |
|
|
|
// 指令 12-上传采集记录 |
|
|
|
start_upload_record_cmd_t* cmd = (start_upload_record_cmd_t*)rxheader->data; |
|
|
|
|
|
|
|