zhaohe 1 year ago
parent
commit
32abd4f74b
  1. 4
      README.md
  2. 2
      app/src/app_ble_service.c
  3. 2
      app/src/basic/version.h
  4. 5
      app/src/device_ctrl_service.c
  5. 2
      dynamic_electrocardiograph_ble_server
  6. 15406
      release/V13/three_lead_ecg.hex
  7. BIN
      release/V13/three_lead_ecg.zip
  8. BIN
      tools/0_bin_parse.exe
  9. 1
      tools/build.bat
  10. 64
      tools/compute_0_bin_checksum.cpp
  11. BIN
      tools/compute_0_bin_checksum.exe
  12. BIN
      tools/text2bin.exe
  13. BIN
      tools/upload_packet_parser.exe

4
README.md

@ -2,6 +2,10 @@
```
V13:
1.修改数据上传间隔由2ms变成20ms
2.添加bin文件checksum计算和文件大小计算工具
V12:
1. 修复上传后,不关闭文件描述符的BUG
2. 添加导联线未插入状态下,开始检测指令回复错误码的功能。

2
app/src/app_ble_service.c

@ -250,7 +250,7 @@ int RecordUpload_start(sample_data_filename_t* recordid) {
return kifyhrs_ecode_no_record_find;
}
ZERROR_CHECK(app_timer_start(m_record_upload_tmr, APP_TIMER_TICKS(2), NULL));
ZERROR_CHECK(app_timer_start(m_record_upload_tmr, APP_TIMER_TICKS(20), NULL));
m_isupload_data_state = true;
m_remaindatalen = 0;
m_report_data_sumcheckcode = 0;

2
app/src/basic/version.h

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

5
app/src/device_ctrl_service.c

@ -66,7 +66,9 @@ void ENTER_DEEP_SLEEP() {
// 使
BoardButton_enable_sense();
// nrf_sdh_disable_request();
app_timer_stop_all();
// app_timer_stop_all();
app_timer_pause();
nrf_sdh_suspend();
nrf_sdh_disable_request();
sd_power_system_off();
NVIC_SystemReset();
@ -85,7 +87,6 @@ static void poweroff() {
zble_module_disconnect();
// sd_ble_gap_disconnect()
BoardLight_setGreenLightEffect(kLightEffect_close);
app_timer_stop_all();
// 使
ENTER_DEEP_SLEEP();

2
dynamic_electrocardiograph_ble_server

@ -1 +1 @@
Subproject commit 41e7b619f0e767affbc04172dd922819af27fda6
Subproject commit b6bd39498f17312e42fb19c0920feea43493ea1d

15406
release/V13/three_lead_ecg.hex
File diff suppressed because it is too large
View File

BIN
release/V13/three_lead_ecg.zip

BIN
tools/0_bin_parse.exe

1
tools/build.bat

@ -1,3 +1,4 @@
g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ .\0_bin_parse.cpp -o 0_bin_parse.exe
g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ text2bin.cpp -o text2bin.exe
g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ upload_packet_parser.cpp -o upload_packet_parser.exe
g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ compute_0_bin_checksum.cpp -o compute_0_bin_checksum.exe

64
tools/compute_0_bin_checksum.cpp

@ -0,0 +1,64 @@
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
//
#include <winsock2.h>
//
#include <Windows.h>
//
#include <stdio.h>
#pragma comment(lib, "ws2_32.lib")
#define PORT 8988
int main(int argc, char *argv[]) {
// 打开 0.bin
// 读取 0.bin 到数组中
// 每次读9byte
// 3byte 3byte 3byte
// 存放到0.csv中
std::ifstream ifs("0.BIN", std::ios::binary);
if (!ifs) {
std::cerr << "open 0.bin failed" << std::endl;
return -1;
}
// 1byte对齐计算checksum
uint32_t size = 0;
uint32_t checksum = 0;
// char readbuf[1024];
// while (ifs.read(readbuf, 1024)) {
// size += ifs.gcount();
// for (int i = 0; i < ifs.gcount(); i++) {
// checksum += (unsigned char)readbuf[i];
// }
// }
char buf[9];
while (ifs.read(buf, 9)) {
size += 9;
for (int i = 0; i < 9; i++) {
checksum += (unsigned char)buf[i];
}
}
printf("size: %d, checksum: %x\n", size, checksum);
while (1) {
Sleep(1000);
}
return 0;
}

BIN
tools/compute_0_bin_checksum.exe

BIN
tools/text2bin.exe

BIN
tools/upload_packet_parser.exe

Loading…
Cancel
Save