Browse Source

更改从buffer主动上报接口参数(回调格式化函数)

devtest
zwsd 3 years ago
parent
commit
403576a827
  1. 4
      main/ble_parse_data.c
  2. 8
      main/ble_parse_data.h

4
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;

8
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);
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();
Loading…
Cancel
Save