diff --git a/app/src/app_ble_service.c b/app/src/app_ble_service.c index 6d7cc28..60013c0 100644 --- a/app/src/app_ble_service.c +++ b/app/src/app_ble_service.c @@ -146,10 +146,11 @@ void prvf_report_sample_data(uint32_t frameIndex, one_frame_data_t* data, int32_ *******************************************************************************/ static int m_upload_fd; -static uint8_t m_datacache[256]; +static uint8_t m_datacache[360]; static int m_remaindatalen = 0; static uint32_t m_report_data_sumcheckcode = 0; static bool m_isupload_data_state = false; +static uint32_t m_upload_cnt = 0; void RecordUpload_report_finish_event(uint32_t sumcheckcode) { ify_hrs_packet_t* txheader = (ify_hrs_packet_t*)m_txbuf; @@ -201,12 +202,12 @@ static void RecordUpload_tmr_cb(void* p_context) { // } int32_t mtusize = zble_module_get_mtu_size(); - mtusize = mtusize < 128 ? mtusize : 128; + mtusize = mtusize < 180 ? mtusize : 180; uint8_t* data = m_datacache + (sizeof(m_datacache) - m_remaindatalen); int len = m_remaindatalen > mtusize ? mtusize : m_remaindatalen; - ZLOGI("upload %d %d %d", len, m_remaindatalen, mtusize); + // ZLOGI("upload %d %d %d", len, m_remaindatalen, mtusize); if (!zdatachannel_is_connected()) { ZLOGI("ble is disconnected,stop upload"); RecordUpload_ble_stop_upload_record(); @@ -233,12 +234,15 @@ static void RecordUpload_tmr_cb(void* p_context) { // m_report_data_sumcheckcode += data[i]; } m_remaindatalen -= len; + m_upload_cnt += len; + ZLOGI("has_upload %d %d", m_upload_cnt, len); } int RecordUpload_start(sample_data_filename_t* recordid) { // // 启动 // + m_upload_cnt = 0; SampleDataMgr_changeToLocalMode(); m_upload_fd = SampleDataMgr_open(recordid, kwrflag_read_only); diff --git a/app/src/basic/version.h b/app/src/basic/version.h index b342aa2..9f5cea9 100644 --- a/app/src/basic/version.h +++ b/app/src/basic/version.h @@ -2,7 +2,7 @@ #define CATEGORY "M1002" // 三导联 #define MANUFACTURER_NAME "iflytop" -#define FIRMWARE_VERSION 0x0002 +#define FIRMWARE_VERSION 0x0003 #define BLESTACK_VERSION 1 #define BOOTLOADER_VERSION 1 #define HARDWARE_VERSION (1) diff --git a/dynamic_electrocardiograph_ble_server b/dynamic_electrocardiograph_ble_server index 03eb63b..d76e1d1 160000 --- a/dynamic_electrocardiograph_ble_server +++ b/dynamic_electrocardiograph_ble_server @@ -1 +1 @@ -Subproject commit 03eb63bb18a16f04fb2aedab5a9c955d66ac7b96 +Subproject commit d76e1d1de74faaca531d54fb588d229a1090d3eb diff --git a/tools/build.bat b/tools/build.bat index 94e4901..6b3dec4 100644 --- a/tools/build.bat +++ b/tools/build.bat @@ -1 +1,2 @@ -g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ .\sample_bin_parse.cpp -o sample_bin_parse.exe \ No newline at end of file +g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ .\sample_bin_parse.cpp -o sample_bin_parse.exe +g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ text2bin.cpp -o text2bin.exe diff --git a/tools/sample_bin_parse.exe b/tools/sample_bin_parse.exe index dfaedda..03920d9 100644 Binary files a/tools/sample_bin_parse.exe and b/tools/sample_bin_parse.exe differ diff --git a/tools/text2bin.cpp b/tools/text2bin.cpp new file mode 100644 index 0000000..5dd2290 --- /dev/null +++ b/tools/text2bin.cpp @@ -0,0 +1,54 @@ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +#include +// +#include +// +#include + +#pragma comment(lib, "ws2_32.lib") +#define PORT 8988 + +int main(int argc, char *argv[]) { + /** + * @brief + * 打开raw.txt + * 读取raw.txt全部内容 + * 去掉换行,空格,回车 + * 将16进制字符串转换成二进制 + * 写入raw.bin + */ + + std::ifstream ifs("raw.txt"); + std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); + ifs.close(); + + std::string str2; + for (auto &c : str) { + if (c == ' ' || c == '\n' || c == '\r') { + continue; + } + str2.push_back(c); + } + + std::ofstream ofs("raw.bin", std::ios::binary); + for (size_t i = 0; i < str2.size(); i += 2) { + std::string str3 = str2.substr(i, 2); + char c = (char)std::stoi(str3, nullptr, 16); + ofs.write(&c, 1); + } + ofs.close(); + + return 0; +} \ No newline at end of file diff --git a/tools/text2bin.exe b/tools/text2bin.exe new file mode 100644 index 0000000..48e0077 Binary files /dev/null and b/tools/text2bin.exe differ