zhaohe 1 year ago
parent
commit
faf336b11b
  1. 6
      README.md
  2. 18
      app/src/app_ble_service.c
  3. 2
      app/src/basic/version.h
  4. 3
      app/src/device_ctrl_service.c
  5. 9
      app/src/heart_wave_sample_service.c
  6. 2
      app/src/heart_wave_sample_service.h
  7. 2
      ify_hrs_protocol

6
README.md

@ -2,6 +2,12 @@
```
V12:
1. 修复上传后,不关闭文件描述符的BUG
2. 添加导联线未插入状态下,开始检测指令回复错误码的功能。
# TODO:
修改蓝牙测试Server程序,测试程序蓝牙名称过滤标志为 iflytop_ble_test_device OK
修改蓝牙名称生成规则,规则为,当device_id为0或者全F,蓝牙名称为iflytop_ble_test_device,否则蓝牙名称为产品SN码 OK

18
app/src/app_ble_service.c

@ -260,6 +260,12 @@ int RecordUpload_stop_upload() {
m_isupload_data_state = false;
SampleDataMgr_changeToExtMode();
app_timer_stop(m_record_upload_tmr);
if (m_upload_fd > 0) {
SampleDataMgr_close(m_upload_fd);
m_upload_fd = 0;
}
return 0;
}
bool RecordUpload_is_uploading() { return m_isupload_data_state; }
@ -364,6 +370,12 @@ static void prvf_process_ble_rx_data(void* p_event_data, uint16_t len) {
if (RecordUpload_is_uploading()) {
ZLOGI("uploading,can not start capture");
send_error_receipt(rxheader, kifyhrs_ecode_device_busy);
return;
}
if (!hwss_line_detect_get_state()) {
send_error_receipt(rxheader, kifyhrs_ecode_electrode_is_not_inserted);
return;
}
DeviceCtrl_startSample(0);
@ -384,6 +396,12 @@ static void prvf_process_ble_rx_data(void* p_event_data, uint16_t len) {
if (RecordUpload_is_uploading()) {
ZLOGI("uploading,can not start capture");
send_error_receipt(rxheader, kifyhrs_ecode_device_busy);
return;
}
if (!hwss_line_detect_get_state()) {
send_error_receipt(rxheader, kifyhrs_ecode_electrode_is_not_inserted);
return;
}
DeviceCtrl_startSample(capture_time_s);

2
app/src/basic/version.h

@ -2,7 +2,7 @@
#define CATEGORY "M1002" // Èýµ¼Áª
#define MANUFACTURER_NAME "iflytop"
#define FIRMWARE_VERSION (11)
#define FIRMWARE_VERSION (12)
#define BLESTACK_VERSION 1
#define BOOTLOADER_VERSION 1
#define HARDWARE_VERSION (1)

3
app/src/device_ctrl_service.c

@ -158,6 +158,9 @@ static void app_event_listener(void* p_event_data, uint16_t event_size) { //
// }
// ZLOGI("button %d", nrf_gpio_pin_read(BUTTON_PIN));
// hwss_line_detect_get_state
// ZLOGI("%d",hwss_line_detect_get_state());
/*******************************************************************************
* *
*******************************************************************************/

9
app/src/heart_wave_sample_service.c

@ -511,6 +511,8 @@ void hwss_init(void) {
inConfig.sense = NRF_GPIOTE_POLARITY_HITOLO; // 沿
ZERROR_CHECK(nrfx_gpiote_in_init(ADS1293_READY_PIN, &inConfig, ads1293_ready_pin_irq));
}
nrf_gpio_cfg_input(LINE_DET_PIN, NRF_GPIO_PIN_PULLUP);
#else
/**
* @brief
@ -623,4 +625,9 @@ void hwss_stop_capture(void) {
bool hwss_is_capturing(void) { return m_work_flag; }
uint8_t hwss_get_drop_state0() { return m_lodstate0; }
uint8_t hwss_get_drop_state1() { return m_lodstate1; }
uint8_t hwss_get_drop_state1() { return m_lodstate1; }
bool hwss_line_detect_get_state(){
return !nrf_gpio_pin_read(LINE_DET_PIN);
}

2
app/src/heart_wave_sample_service.h

@ -35,3 +35,5 @@ uint32_t hwss_started_has_passed_s(void);
uint8_t hwss_get_drop_state0();
uint8_t hwss_get_drop_state1();
bool hwss_line_detect_get_state();

2
ify_hrs_protocol

@ -1 +1 @@
Subproject commit da8e07706a41c157a3e42da3f69136f665f5a20f
Subproject commit f2eae40f67048820f37dc5dd3585ca9a75156dfc
Loading…
Cancel
Save