diff --git a/main/ble_spp_client_demo.c b/main/ble_spp_client_demo.c index 40f14ff..cb70f35 100644 --- a/main/ble_spp_client_demo.c +++ b/main/ble_spp_client_demo.c @@ -693,7 +693,7 @@ void ble_init() spp_uart_init(); } -void ble_gattc_write_char_cb(char *string, uint8_t string_length) +void ble_gattc_write_char(char *string, uint8_t string_length) { if ((is_connect == true) && (db != NULL) && ((db + SPP_IDX_SPP_DATA_RECV_VAL)->properties & (ESP_GATT_CHAR_PROP_BIT_WRITE_NR | ESP_GATT_CHAR_PROP_BIT_WRITE))) { diff --git a/main/ble_spp_client_demo.h b/main/ble_spp_client_demo.h index 6a018c9..a451466 100644 --- a/main/ble_spp_client_demo.h +++ b/main/ble_spp_client_demo.h @@ -33,4 +33,4 @@ enum }; void ble_init(); -void ble_gattc_write_char_cb(char *string, uint8_t string_length); \ No newline at end of file +void ble_gattc_write_char(char *string, uint8_t string_length); \ No newline at end of file diff --git a/main/key.c b/main/key.c index 8afca72..3e4ce75 100644 --- a/main/key.c +++ b/main/key.c @@ -2,7 +2,7 @@ #include "esp_log.h" #include "driver/gpio.h" -static key_ble_cb_t s_ble_gattc_write_char_cb; +static key_ble_cb_t s_ble_gattc_write_char; void key_init() { @@ -27,7 +27,7 @@ void key_schedule() while (gpio_get_level(KEY_REC) == 0) { } - s_ble_gattc_write_char_cb(send_string, strlen(send_string)); + s_ble_gattc_write_char(send_string, strlen(send_string)); ESP_LOGI("Finny", "stop"); } if (gpio_get_level(KEY_MODE) == 0) @@ -38,9 +38,9 @@ void key_schedule() while (gpio_get_level(KEY_MODE) == 0) { } - s_ble_gattc_write_char_cb(send_string, strlen(send_string)); + s_ble_gattc_write_char(send_string, strlen(send_string)); ESP_LOGI("Finny", "stop"); } } -void key_ble_send_cmd_reg(key_ble_cb_t cb) { s_ble_gattc_write_char_cb = cb; }; \ No newline at end of file +void key_ble_send_cmd_reg(key_ble_cb_t cb) { s_ble_gattc_write_char = cb; }; \ No newline at end of file diff --git a/main/main.c b/main/main.c index dfd3cd4..a790a64 100644 --- a/main/main.c +++ b/main/main.c @@ -45,7 +45,7 @@ void pc_uart_receive(uart_port_t uart_num) if (length != 0) { length = uart_read_bytes(uart_num, rx_data_buffer, length, 100); - ble_gattc_write_char_cb((char *)rx_data_buffer, length); + ble_gattc_write_char((char *)rx_data_buffer, length); } } @@ -54,7 +54,7 @@ void app_main(void) ble_init(); key_init(); - key_ble_send_cmd_reg(ble_gattc_write_char_cb); + key_ble_send_cmd_reg(ble_gattc_write_char); pc_uart_init(UART_NUM_2, 18, 23);