From 403576a8279c1841071a75d8cc600cbb4549520f Mon Sep 17 00:00:00 2001 From: zwsd Date: Thu, 21 Jul 2022 18:15:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BB=8Ebuffer=E4=B8=BB?= =?UTF-8?q?=E5=8A=A8=E4=B8=8A=E6=8A=A5=E6=8E=A5=E5=8F=A3=E5=8F=82=E6=95=B0?= =?UTF-8?q?(=E5=9B=9E=E8=B0=83=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=87=BD?= =?UTF-8?q?=E6=95=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/ble_parse_data.c | 4 ++-- main/ble_parse_data.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/main/ble_parse_data.c b/main/ble_parse_data.c index c1c99d8..352b2ff 100644 --- a/main/ble_parse_data.c +++ b/main/ble_parse_data.c @@ -197,7 +197,7 @@ void bluetooth_auto_report_format_receipt() { parse_bluetooth_processer->index, parse_bluetooth_processer->speedLevel, parse_bluetooth_processer->position, parse_bluetooth_processer->direction); } -void bluetooth_tx_buffer_send_indicate() { +void bluetooth_tx_buffer_send_indicate(cb_t format) { char temp_buffer[20] = {0}; uint8_t temp_lenght = 0; uint8_t temp_count_total = 0; @@ -205,7 +205,7 @@ void bluetooth_tx_buffer_send_indicate() { uint8_t temp_count_remainder = 0; uint8_t i = 0; - bluetooth_auto_report_format_receipt(); + format(); temp_lenght = strlen(parse_bluetooth_processer->bluetooth_processer_tx_buf); temp_count_total = temp_lenght / 15; diff --git a/main/ble_parse_data.h b/main/ble_parse_data.h index 46ba18f..659aefa 100644 --- a/main/ble_parse_data.h +++ b/main/ble_parse_data.h @@ -46,6 +46,8 @@ typedef struct bluetooth_processer { } bluetooth_processer_t; +typedef void (*cb_t)(); + void constructor_bluetooth_processer(bluetooth_processer_t *bluetooth_processer); void bluetooth_gatts_try_process_data(); void start_receive_data_to_buffer(uint16_t length, uint8_t *value); @@ -55,5 +57,7 @@ bool parse_json_to_struct(cJSON *ch); void receipt_json_set_position(); void receipt_json_get_status(); void bluetooth_auto_report_format_receipt(); -void bluetooth_tx_buffer_send_indicate(); -void string_copy_by_num(char *dest, const char *src, uint8_t count, uint8_t num); \ No newline at end of file +void bluetooth_tx_buffer_send_indicate(cb_t format); +void string_copy_by_num(char *dest, const char *src, uint8_t count, uint8_t num); + +void auto_send_device_state(); \ No newline at end of file