From 698c0aa3f5d02d393ca6171598c85d550b1e03b4 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 25 Jan 2024 16:48:31 +0800 Subject: [PATCH] update --- app/main.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/app/main.c b/app/main.c index d9aefdf..704a210 100644 --- a/app/main.c +++ b/app/main.c @@ -415,12 +415,45 @@ static const char* hex2str(const uint8_t* data, int32_t len) { return rx; } +// void cmd_remove_note(char* input, int inputlen) { +// bool detect_note = false; +// for (int i = 0; i < inputlen; i++) { +// if (!detect_note && input[i] == '#') { +// detect_note = true; +// } +// if (detect_note) { +// input[i] = 0; +// } +// } +// } +// void cmd_prase_cmd(char* input, int inputlen, int32_t* argc, char* argv[]) { +// for (int i = 0; input[i] == 0 || i < inputlen; i++) { +// if (input[i] == ' ' || input[i] == '\r' || input[i] == '\n') { +// input[i] = 0; +// } +// } +// int j = 0; +// for (int i = 0; input[i] == 0 || i < inputlen; i++) { +// if (input[i] != 0 && j == 0) { +// argv[*argc] = &input[i]; +// j = 1; +// *argc = *argc + 1; +// continue; +// } + +// if (input[i] == 0 && j == 1) { +// j = 0; +// continue; +// } +// } +// } +char cmdcache[256] = {0}; static void zdatachannel_data_handler(zdatachannel_evt_t* p_evt) { /** * @brief 接收到指令数据 */ if (p_evt->type == ZDATACHANNEL_EVT_RX_DATA) { - ZLOGI("rx:%s", hex2str(p_evt->params.rx_data.p_data, p_evt->params.rx_data.length)); + } } static void on_service_init(void) {