diff --git a/app/app.uvoptx b/app/app.uvoptx
index 6ba3852..1f4e742 100644
--- a/app/app.uvoptx
+++ b/app/app.uvoptx
@@ -427,6 +427,18 @@
0
0
+
+ 1
+ 6
+ 1
+ 0
+ 0
+ 0
+ .\src\ble_data_processer_utils.c
+ ble_data_processer_utils.c
+ 0
+ 0
+
@@ -437,7 +449,7 @@
0
2
- 6
+ 7
1
0
0
@@ -457,7 +469,7 @@
0
3
- 7
+ 8
1
0
0
@@ -469,7 +481,7 @@
3
- 8
+ 9
1
0
0
@@ -489,7 +501,7 @@
0
4
- 9
+ 10
1
0
0
@@ -509,7 +521,7 @@
0
5
- 10
+ 11
1
0
0
@@ -521,7 +533,7 @@
5
- 11
+ 12
1
0
0
@@ -533,7 +545,7 @@
5
- 12
+ 13
1
0
0
@@ -545,7 +557,7 @@
5
- 13
+ 14
1
0
0
@@ -557,7 +569,7 @@
5
- 14
+ 15
1
0
0
@@ -569,7 +581,7 @@
5
- 15
+ 16
1
0
0
@@ -581,7 +593,7 @@
5
- 16
+ 17
1
0
0
@@ -593,7 +605,7 @@
5
- 17
+ 18
1
0
0
@@ -613,7 +625,7 @@
0
6
- 18
+ 19
1
0
0
@@ -627,13 +639,13 @@
nRF_Drivers
- 1
+ 0
0
0
0
7
- 19
+ 20
1
0
0
@@ -645,7 +657,7 @@
7
- 20
+ 21
1
0
0
@@ -657,7 +669,7 @@
7
- 21
+ 22
1
0
0
@@ -669,7 +681,7 @@
7
- 22
+ 23
1
0
0
@@ -681,7 +693,7 @@
7
- 23
+ 24
1
0
0
@@ -693,7 +705,7 @@
7
- 24
+ 25
1
0
0
@@ -705,7 +717,7 @@
7
- 25
+ 26
1
0
0
@@ -717,7 +729,7 @@
7
- 26
+ 27
1
0
0
@@ -729,7 +741,7 @@
7
- 27
+ 28
1
0
0
@@ -741,7 +753,7 @@
7
- 28
+ 29
1
0
0
@@ -753,7 +765,7 @@
7
- 29
+ 30
1
0
0
@@ -765,7 +777,7 @@
7
- 30
+ 31
1
0
0
@@ -777,7 +789,7 @@
7
- 31
+ 32
1
0
0
@@ -789,7 +801,7 @@
7
- 32
+ 33
1
0
0
@@ -801,7 +813,7 @@
7
- 33
+ 34
1
0
0
@@ -813,7 +825,7 @@
7
- 34
+ 35
1
0
0
@@ -825,7 +837,7 @@
7
- 35
+ 36
1
0
0
@@ -837,7 +849,7 @@
7
- 36
+ 37
1
0
0
@@ -849,7 +861,7 @@
7
- 37
+ 38
1
0
0
@@ -861,7 +873,7 @@
7
- 38
+ 39
1
0
0
@@ -873,7 +885,7 @@
7
- 39
+ 40
1
0
0
@@ -893,7 +905,7 @@
0
8
- 40
+ 41
1
0
0
@@ -905,7 +917,7 @@
8
- 41
+ 42
1
0
0
@@ -917,7 +929,7 @@
8
- 42
+ 43
1
0
0
@@ -929,7 +941,7 @@
8
- 43
+ 44
1
0
0
@@ -941,7 +953,7 @@
8
- 44
+ 45
1
0
0
@@ -953,7 +965,7 @@
8
- 45
+ 46
1
0
0
@@ -965,7 +977,7 @@
8
- 46
+ 47
1
0
0
@@ -977,7 +989,7 @@
8
- 47
+ 48
1
0
0
@@ -989,7 +1001,7 @@
8
- 48
+ 49
1
0
0
@@ -1001,7 +1013,7 @@
8
- 49
+ 50
1
0
0
@@ -1013,7 +1025,7 @@
8
- 50
+ 51
1
0
0
@@ -1025,7 +1037,7 @@
8
- 51
+ 52
1
0
0
@@ -1037,7 +1049,7 @@
8
- 52
+ 53
1
0
0
@@ -1049,7 +1061,7 @@
8
- 53
+ 54
1
0
0
@@ -1061,7 +1073,7 @@
8
- 54
+ 55
1
0
0
@@ -1073,7 +1085,7 @@
8
- 55
+ 56
1
0
0
@@ -1085,7 +1097,7 @@
8
- 56
+ 57
1
0
0
@@ -1097,7 +1109,7 @@
8
- 57
+ 58
1
0
0
@@ -1109,7 +1121,7 @@
8
- 58
+ 59
1
0
0
@@ -1121,7 +1133,7 @@
8
- 59
+ 60
1
0
0
@@ -1133,7 +1145,7 @@
8
- 60
+ 61
1
0
0
@@ -1145,7 +1157,7 @@
8
- 61
+ 62
1
0
0
@@ -1157,7 +1169,7 @@
8
- 62
+ 63
1
0
0
@@ -1169,7 +1181,7 @@
8
- 63
+ 64
1
0
0
@@ -1181,7 +1193,7 @@
8
- 64
+ 65
1
0
0
@@ -1193,7 +1205,7 @@
8
- 65
+ 66
1
0
0
@@ -1205,7 +1217,7 @@
8
- 66
+ 67
1
0
0
@@ -1225,7 +1237,7 @@
0
9
- 67
+ 68
1
0
0
@@ -1237,7 +1249,7 @@
9
- 68
+ 69
1
0
0
@@ -1249,7 +1261,7 @@
9
- 69
+ 70
1
0
0
@@ -1261,7 +1273,7 @@
9
- 70
+ 71
1
0
0
@@ -1273,7 +1285,7 @@
9
- 71
+ 72
1
0
0
@@ -1285,7 +1297,7 @@
9
- 72
+ 73
1
0
0
@@ -1305,7 +1317,7 @@
0
10
- 73
+ 74
1
0
0
@@ -1317,7 +1329,7 @@
10
- 74
+ 75
1
0
0
@@ -1329,7 +1341,7 @@
10
- 75
+ 76
1
0
0
@@ -1349,7 +1361,7 @@
0
11
- 76
+ 77
1
0
0
@@ -1361,7 +1373,7 @@
11
- 77
+ 78
1
0
0
@@ -1373,7 +1385,7 @@
11
- 78
+ 79
1
0
0
@@ -1393,7 +1405,7 @@
0
12
- 79
+ 80
1
0
0
@@ -1405,7 +1417,7 @@
12
- 80
+ 81
1
0
0
@@ -1417,7 +1429,7 @@
12
- 81
+ 82
1
0
0
@@ -1437,7 +1449,7 @@
0
13
- 82
+ 83
1
0
0
@@ -1449,7 +1461,7 @@
13
- 83
+ 84
1
0
0
@@ -1461,7 +1473,7 @@
13
- 84
+ 85
1
0
0
@@ -1473,7 +1485,7 @@
13
- 85
+ 86
1
0
0
@@ -1485,7 +1497,7 @@
13
- 86
+ 87
1
0
0
@@ -1505,7 +1517,7 @@
0
14
- 87
+ 88
1
0
0
@@ -1517,7 +1529,7 @@
14
- 88
+ 89
1
0
0
@@ -1529,7 +1541,7 @@
14
- 89
+ 90
1
0
0
@@ -1541,7 +1553,7 @@
14
- 90
+ 91
1
0
0
@@ -1555,13 +1567,13 @@
app_service
- 0
+ 1
0
0
0
15
- 91
+ 92
1
0
0
@@ -1573,7 +1585,7 @@
15
- 92
+ 93
1
0
0
@@ -1585,7 +1597,7 @@
15
- 93
+ 94
1
0
0
@@ -1597,7 +1609,7 @@
15
- 94
+ 95
1
0
0
@@ -1609,7 +1621,7 @@
15
- 95
+ 96
1
0
0
@@ -1621,7 +1633,7 @@
15
- 96
+ 97
1
0
0
@@ -1633,7 +1645,7 @@
15
- 97
+ 98
1
0
0
@@ -1645,7 +1657,7 @@
15
- 98
+ 99
1
0
0
@@ -1657,7 +1669,7 @@
15
- 99
+ 100
1
0
0
@@ -1669,7 +1681,7 @@
15
- 100
+ 101
1
0
0
@@ -1681,7 +1693,7 @@
15
- 101
+ 102
1
0
0
@@ -1693,7 +1705,7 @@
15
- 102
+ 103
1
0
0
@@ -1705,7 +1717,7 @@
15
- 103
+ 104
1
0
0
@@ -1717,7 +1729,7 @@
15
- 104
+ 105
1
0
0
@@ -1729,7 +1741,7 @@
15
- 105
+ 106
1
0
0
@@ -1741,7 +1753,7 @@
15
- 106
+ 107
1
0
0
@@ -1753,7 +1765,7 @@
15
- 107
+ 108
1
0
0
@@ -1765,7 +1777,7 @@
15
- 108
+ 109
1
0
0
diff --git a/app/app.uvprojx b/app/app.uvprojx
index f5d9c88..325084f 100644
--- a/app/app.uvprojx
+++ b/app/app.uvprojx
@@ -408,6 +408,11 @@
1
.\src\app_basic_service\device_version_info_mgr.c
+
+ ble_data_processer_utils.c
+ 1
+ .\src\ble_data_processer_utils.c
+
@@ -4312,6 +4317,11 @@
1
.\src\app_basic_service\device_version_info_mgr.c
+
+ ble_data_processer_utils.c
+ 1
+ .\src\ble_data_processer_utils.c
+
diff --git a/app/src/app_basic_service/basic/event.h b/app/src/app_basic_service/basic/event.h
index 6b5e221..ee7b30a 100644
--- a/app/src/app_basic_service/basic/event.h
+++ b/app/src/app_basic_service/basic/event.h
@@ -5,24 +5,23 @@
#include "aproject_config/config.h"
#include "ify_hrs_protocol/heart_rate_sensor_protocol.h"
-#define ECG_DATA_REPORT_FRAME_NUM 32 // ecg每次上报的帧数
+#define ECG_DATA_REPORT_FRAME_NUM 64 // ecg每次上报的帧数
typedef enum {
kevent_tmr_scheduler_event,
- kecg_data_report_event, // ecg数据上报事件
kappevent_battery_start_charge, // 开始充电事件
kappevent_battery_end_charge, // 停止充电事件
kappevent_start_capture,
kappevent_stop_capture,
+ kecg_data_report_event, // ecg数据上报事件
} app_event_type_t;
typedef struct {
uint8_t leadoff;
int32_t data;
-
} one_frame_t;
typedef struct {
@@ -31,12 +30,12 @@ typedef struct {
typedef struct {
app_event_type_t eventType;
- uint8_t *hang_up_flag;
+ uint8_t* hang_up_flag;
union {
struct {
uint32_t frameIndex;
+ uint8_t leadoffstate;
ecg_report_data_t* ecgData;
} ecg_data_report_event;
-
} val;
} app_event_t;
\ No newline at end of file
diff --git a/app/src/ble_data_processer_utils.c b/app/src/ble_data_processer_utils.c
new file mode 100644
index 0000000..b884016
--- /dev/null
+++ b/app/src/ble_data_processer_utils.c
@@ -0,0 +1,53 @@
+#include "ble_data_processer_utils.h"
+
+#include "ify_hrs_protocol/heart_rate_sensor_protocol.h"
+#include "zdatachannel_service.h"
+
+static uint8_t _bletxbuf[BLE_MSG_BUF_SIZE];
+static uint8_t blereportbuf[BLE_MSG_BUF_SIZE];
+
+void bletxbuf_clear() { memset(_bletxbuf, 0, BLE_MSG_BUF_SIZE); }
+ify_hrs_packet_t* bletxbuf_get() { return (ify_hrs_packet_t*)_bletxbuf; }
+
+void send_error_receipt(ify_hrs_packet_t* rxpacket, int32_t errorcode) {
+ ify_hrs_packet_t* txheader = (ify_hrs_packet_t*)_bletxbuf;
+ error_receipt_t* receipt = (error_receipt_t*)txheader->data;
+ uint16_t sendlen = sizeof(ify_hrs_packet_t) + sizeof(error_receipt_t);
+
+ txheader->cmd = rxpacket->cmd;
+ txheader->frame_index = rxpacket->frame_index;
+ txheader->frame_type = kifyhrs_pt_error_receipt;
+ receipt->errorcode = errorcode;
+ zdatachannel_data_send2(_bletxbuf, sendlen);
+}
+
+void send_success_receipt(ify_hrs_packet_t* rxpacket, int32_t emptydatasize) {
+ ify_hrs_packet_t* txheader = (ify_hrs_packet_t*)_bletxbuf;
+ uint16_t sendlen = sizeof(ify_hrs_packet_t) + emptydatasize;
+
+ txheader->cmd = rxpacket->cmd;
+ txheader->frame_index = rxpacket->frame_index;
+ txheader->frame_type = kifyhrs_pt_cmd_receipt;
+
+ zdatachannel_data_send2(_bletxbuf, sendlen);
+}
+
+/**
+ * @brief 上报数据
+ */
+
+void report_ecg_data(app_event_t* data) {
+ m1003_heartrate_report_packet_t* reportpacket = (m1003_heartrate_report_packet_t*)blereportbuf;
+ reportpacket->cmd = ify_hrs_report_heartrate_data;
+ reportpacket->frame_index = 0;
+ reportpacket->frame_type = kifyhrs_pt_report;
+ reportpacket->sample_data_index = data->val.ecg_data_report_event.frameIndex;
+ reportpacket->leadoff_state = data->val.ecg_data_report_event.leadoffstate;
+ reportpacket->sample_data_num = ECG_DATA_REPORT_FRAME_NUM;
+
+ for (int i = 0; i < ECG_DATA_REPORT_FRAME_NUM; i++) {
+ reportpacket->frame[i] = data->val.ecg_data_report_event.ecgData->frame[i].data;
+ }
+ zdatachannel_data_send2(blereportbuf, //
+ sizeof(m1003_heartrate_report_packet_t) + ECG_DATA_REPORT_FRAME_NUM * sizeof(reportpacket->frame[0]));
+}
diff --git a/app/src/ble_data_processer_utils.h b/app/src/ble_data_processer_utils.h
new file mode 100644
index 0000000..d8bf726
--- /dev/null
+++ b/app/src/ble_data_processer_utils.h
@@ -0,0 +1,16 @@
+#pragma once
+#include
+
+#include "app_basic_service/zapp.h"
+#include "ify_hrs_protocol/heart_rate_sensor_protocol.h"
+#define BLE_MSG_BUF_SIZE 255
+
+extern uint8_t bletxbuf[];
+extern uint8_t blereportbuf[];
+
+void bletxbuf_clear();
+ify_hrs_packet_t* bletxbuf_get();
+
+void send_error_receipt(ify_hrs_packet_t* rxpacket, int32_t errorcode);
+void send_success_receipt(ify_hrs_packet_t* rxpacket, int32_t emptydatasize);
+void report_ecg_data(app_event_t* data);
\ No newline at end of file
diff --git a/app/src/one_conduction_main.c b/app/src/one_conduction_main.c
index ea1f098..1ac1f9f 100644
--- a/app/src/one_conduction_main.c
+++ b/app/src/one_conduction_main.c
@@ -16,6 +16,7 @@
#include "app_service/light_ctrl.h"
#include "zble_module.h"
//
+#include "ble_data_processer_utils.h"
#include "nrf_fstorage.h"
#include "nrf_fstorage_sd.h"
@@ -23,35 +24,11 @@
* GLOBAL *
***********************************************************************************************************************/
-static uint8_t bletxbuf[255];
-static uint8_t blereportbuf[255];
-static bool m_poweron_flag;
+static bool m_poweron_flag;
/*******************************************************************************
* UTILS *
*******************************************************************************/
-static void send_error_receipt(ify_hrs_packet_t* rxpacket, int32_t errorcode) {
- ify_hrs_packet_t* txheader = (ify_hrs_packet_t*)bletxbuf;
- error_receipt_t* receipt = (error_receipt_t*)txheader->data;
- uint16_t sendlen = sizeof(ify_hrs_packet_t) + sizeof(error_receipt_t);
-
- txheader->cmd = rxpacket->cmd;
- txheader->frame_index = rxpacket->frame_index;
- txheader->frame_type = kifyhrs_pt_error_receipt;
- receipt->errorcode = errorcode;
- zdatachannel_data_send2(bletxbuf, sendlen);
-}
-
-static void send_success_receipt(ify_hrs_packet_t* rxpacket, int32_t emptydatasize) {
- ify_hrs_packet_t* txheader = (ify_hrs_packet_t*)bletxbuf;
- uint16_t sendlen = sizeof(ify_hrs_packet_t) + emptydatasize;
-
- txheader->cmd = rxpacket->cmd;
- txheader->frame_index = rxpacket->frame_index;
- txheader->frame_type = kifyhrs_pt_cmd_receipt;
-
- zdatachannel_data_send2(bletxbuf, sendlen);
-}
/***********************************************************************************************************************
* 蓝牙连接事件处理 *
@@ -83,20 +60,16 @@ void on_zble_event(zble_event_t* event) {
* 蓝牙消息处理 *
***********************************************************************************************************************/
void one_conduction_process_rx_packet(uint8_t* rx, int len) {
- /**
- * @brief
- *
- */
+ ify_hrs_packet_t* rxheader = (ify_hrs_packet_t*)rx;
+ ify_hrs_packet_t* txheader = bletxbuf_get();
+ ify_hrs_cmd_t cmd = (ify_hrs_cmd_t)rxheader->cmd;
if (len < sizeof(ify_hrs_packet_t)) {
ZLOGI("rx len error:%d", len);
return;
}
- ify_hrs_packet_t* rxheader = (ify_hrs_packet_t*)rx;
- ify_hrs_packet_t* txheader = (ify_hrs_packet_t*)bletxbuf;
- ify_hrs_cmd_t cmd = (ify_hrs_cmd_t)rxheader->cmd;
- memset(bletxbuf, 0, sizeof(bletxbuf));
+ bletxbuf_clear();
txheader->cmd = rxheader->cmd;
txheader->frame_index = rxheader->frame_index;
@@ -113,7 +86,7 @@ void one_conduction_process_rx_packet(uint8_t* rx, int len) {
receipt->bootloader_version = device_info_read_bootloader_version();
receipt->firmware_version = device_info_read_firmware_version();
receipt->hardware_version = device_info_read_hardware_version();
- zdatachannel_data_send2(bletxbuf, sendlen);
+ zdatachannel_data_send2((uint8_t*)txheader, sendlen);
}
else if (cmd == ify_hrs_cmd_read_sensor_info) {
@@ -127,14 +100,14 @@ void one_conduction_process_rx_packet(uint8_t* rx, int len) {
receipt->sensor1_pos = kifyhrs_sensor_pos_none;
receipt->sensor2_pos = kifyhrs_sensor_pos_none;
- zdatachannel_data_send2(bletxbuf, sendlen);
+ zdatachannel_data_send2((uint8_t*)txheader, sendlen);
}
else if (cmd == ify_hrs_cmd_read_sn) {
read_sn_receipt_t* receipt = (read_sn_receipt_t*)txheader->data;
uint16_t sendlen = sizeof(ify_hrs_packet_t) + sizeof(read_sn_receipt_t);
device_info_read_sn((sn_t*)&receipt->sn);
- zdatachannel_data_send2(bletxbuf, sendlen);
+ zdatachannel_data_send2((uint8_t*)txheader, sendlen);
}
else if (cmd == ify_hrs_cmd_reset) {
@@ -153,15 +126,15 @@ void one_conduction_process_rx_packet(uint8_t* rx, int len) {
receipt->hour = ztm.tm_hour;
receipt->minute = ztm.tm_min;
receipt->second = ztm.tm_sec;
- zdatachannel_data_send2(bletxbuf, sendlen);
+ zdatachannel_data_send2((uint8_t*)txheader, sendlen);
}
else if (cmd == ify_hrs_cmd_sync_time) {
sync_time_cmd_t* cmd = (sync_time_cmd_t*)rxheader->data;
uint16_t sendlen = sizeof(ify_hrs_packet_t);
-
+ device_info_write_active_flag(true);
znordic_rtc_settime(cmd->year + 2000, cmd->month, cmd->day, cmd->hour, cmd->minute, cmd->second);
- zdatachannel_data_send2(bletxbuf, sendlen);
+ zdatachannel_data_send2((uint8_t*)txheader, sendlen);
}
/***********************************************************************************************************************
@@ -183,12 +156,12 @@ void one_conduction_process_rx_packet(uint8_t* rx, int len) {
receipt->powerlevel = battery_mgr_service_get_battery_level();
receipt->storage_item_num = 0;
- zdatachannel_data_send2(bletxbuf, sendlen);
+ zdatachannel_data_send2((uint8_t*)txheader, sendlen);
}
else if (cmd == ify_hrs_cmd_start_realtime_preview) {
- if (zapp_state_machine_now_state() != kstate_mainPage) {
- send_error_receipt(rxheader, kifyhrs_ecode_device_busy);
+ if (zapp_state_machine_now_state() != kstate_mainPage && zapp_state_machine_now_state() != kstate_welcomPage) {
+ send_error_receipt(rxheader, kifyhrs_ecode_invalid_state);
return;
}
static app_event_t event;
@@ -199,8 +172,8 @@ void one_conduction_process_rx_packet(uint8_t* rx, int len) {
}
else if (cmd == ify_hrs_cmd_stop_realtime_preview) {
- if (zapp_state_machine_now_state() != kstate_mainPage) {
- send_error_receipt(rxheader, kifyhrs_ecode_device_busy);
+ if (zapp_state_machine_now_state() != kstate_capture) {
+ send_error_receipt(rxheader, kifyhrs_ecode_invalid_state);
return;
}
@@ -220,11 +193,15 @@ void one_conduction_process_rx_packet(uint8_t* rx, int len) {
* 状态切换 *
***********************************************************************************************************************/
void on_state_change(device_state_t from, device_state_t to) {
+ if (from == to) return;
+
/**
- * @brief 开机
+ * @brief 状态退出
*/
-
- if (from == kstate_standby && to != kstate_standby) {
+ if (from == kstate_standby) {
+ /**
+ * @brief 开机
+ */
ZLOGI("power on");
hardware_power_mgr_main_power_supply_set(true);
battery_mgr_service_change_state_to_poweron();
@@ -238,13 +215,22 @@ void on_state_change(device_state_t from, device_state_t to) {
if (zble_module_is_connected()) {
light_ctrl_set_green_light_effect(kLightEffect_slowFlash);
}
-
+ } else if (from == kstate_welcomPage) {
+ } else if (from == kstate_mainPage) {
+ } else if (from == kstate_capture) {
+ ecg_service_stop_capture();
+ } else if (from == kstate_charging) {
}
+
/**
- * @brief 关机
+ * @brief 进入状态
*/
- else if (from != kstate_standby && to == kstate_standby) {
+ if (to == kstate_standby) {
+ /**
+ * @brief 关机
+ */
ZLOGI("power off");
+ dsp_mgr_change_page(kpage_poweroff);
battery_mgr_service_change_state_to_standy();
@@ -256,16 +242,14 @@ void on_state_change(device_state_t from, device_state_t to) {
// battery_mgr_service_change_state_to_standy();
hardware_power_mgr_main_power_supply_set(false);
m_poweron_flag = false;
- }
- if (to == kstate_standby) {
- dsp_mgr_change_page(kpage_poweroff);
} else if (to == kstate_welcomPage) {
dsp_mgr_change_page(kpage_welcome);
} else if (to == kstate_mainPage) {
dsp_mgr_change_page(kpage_main);
} else if (to == kstate_capture) {
dsp_mgr_change_page(kpage_sampling);
+ ecg_service_start_capture();
} else if (to == kstate_charging) {
dsp_mgr_change_page(kpage_charging_page);
}
@@ -295,10 +279,13 @@ void on_zapp_ebus_event(void* p_event_data, uint16_t event_size) {
* @brief
* 延迟1.5s切换到主页面
*/
- if (zapp_state_machine_haspassed_ms() >= 2000) {
+ if (p_event->eventType == kappevent_start_capture) {
+ zapp_state_machine_change_state(kstate_capture);
+ } else if (zapp_state_machine_haspassed_ms() >= 2000) {
zapp_state_machine_change_state(kstate_mainPage);
beep_set_effect(POWER_ON_EFFECT);
}
+
} else if (zapp_state_machine_now_state() == kstate_mainPage) {
/**
* @brief
@@ -319,9 +306,15 @@ void on_zapp_ebus_event(void* p_event_data, uint16_t event_size) {
/**
* @brief
* 1. 停止采集指令->切换到MainPage
+ * 2. 断开连接 ->切换到关机状态
*/
- if (p_event->eventType == kappevent_stop_capture) {
+
+ if (zble_module_has_disconnected_ms() >= 1000) {
+ zapp_state_machine_change_state(kstate_standby);
+ } else if (p_event->eventType == kappevent_stop_capture) {
zapp_state_machine_change_state(kstate_mainPage);
+ } else if (p_event->eventType == kecg_data_report_event) {
+ report_ecg_data(p_event);
}
} else if (zapp_state_machine_now_state() == kstate_charging) {
/**
diff --git a/ify_hrs_protocol b/ify_hrs_protocol
index 6bceb37..08b14b4 160000
--- a/ify_hrs_protocol
+++ b/ify_hrs_protocol
@@ -1 +1 @@
-Subproject commit 6bceb372ed9409f8a4ac2a365b7af800f0a2353b
+Subproject commit 08b14b499e98175014068f19fdfaddded14718b3
diff --git a/release/test_version/README.md b/release/test_version/README.md
new file mode 100644
index 0000000..5f85a15
--- /dev/null
+++ b/release/test_version/README.md
@@ -0,0 +1 @@
+用于测试ads1291驱动的功能,支持修改ads1291寄存器等功能
\ No newline at end of file
diff --git a/release/test_version/蹇冪數涓婁綅鏈篤2.exe b/release/test_version/蹇冪數涓婁綅鏈篤2.exe
new file mode 100644
index 0000000..cb213cc
Binary files /dev/null and b/release/test_version/蹇冪數涓婁綅鏈篤2.exe differ
diff --git a/release/test_version/蹇冪數娴嬭瘯涓婁綅鏈.zip b/release/test_version/蹇冪數娴嬭瘯涓婁綅鏈.zip
new file mode 100644
index 0000000..1c8f652
Binary files /dev/null and b/release/test_version/蹇冪數娴嬭瘯涓婁綅鏈.zip differ