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