From fa5ad80d7f3bd36cc462f6b7f81091f085349f2c Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 9 May 2024 09:47:56 +0800 Subject: [PATCH] update --- app/src/one_conduction_main.c | 19 +++++++++++++++++++ ify_hrs_protocol | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/src/one_conduction_main.c b/app/src/one_conduction_main.c index 755f3ae..7110ebe 100644 --- a/app/src/one_conduction_main.c +++ b/app/src/one_conduction_main.c @@ -184,6 +184,9 @@ void one_conduction_process_rx_packet(uint8_t* rx, int len) { send_success_receipt(rxheader, 0); } + /*********************************************************************************************************************** + * ²âÊÔ * + ***********************************************************************************************************************/ else if (cmd == ify_hrs_cmd_set_ecg_in_test_mode) { int32_t testmode = *(int32_t*)rxheader->data; ecg_service_set_in_test_mode(testmode); @@ -196,6 +199,22 @@ void one_conduction_process_rx_packet(uint8_t* rx, int len) { send_success_receipt(rxheader, 0); } + + + else if (cmd == ify_hrs_cmd_ecg_subic_read_reg) { + uint8_t addr = *(uint8_t*)rxheader->data; + uint8_t val = ecg_service_subic_read_reg(addr); + txheader->data[0] = val; + zdatachannel_data_send2((uint8_t*)txheader, sizeof(ify_hrs_packet_t) + 1); + } + + else if (cmd == ify_hrs_cmd_ecg_subic_write_reg) { + uint8_t addr = *(uint8_t*)rxheader->data; + uint8_t val = *(uint8_t*)(rxheader->data + 1); + ecg_service_subic_write_reg(addr, val); + send_success_receipt(rxheader, 0); + } + else { send_error_receipt(rxheader, kifyhrs_ecode_cmd_not_support); } diff --git a/ify_hrs_protocol b/ify_hrs_protocol index a532e43..c5a8617 160000 --- a/ify_hrs_protocol +++ b/ify_hrs_protocol @@ -1 +1 @@ -Subproject commit a532e43847aa8dd525f86748104a496ec561e841 +Subproject commit c5a86174de8f27f4c8ab6c18dd131effa7b43ea5