diff --git a/platform/embedded/btstack_uart_block_embedded.c b/platform/embedded/btstack_uart_block_embedded.c index 0ac77c2a7..0a58e43f0 100644 --- a/platform/embedded/btstack_uart_block_embedded.c +++ b/platform/embedded/btstack_uart_block_embedded.c @@ -50,7 +50,7 @@ #include "hal_uart_dma.h" // uart config -static const btstack_uart_config_t * uart_configuration; +static const btstack_uart_config_t * btstack_uart_block_configuration; // data source for integration with BTstack Runloop static btstack_data_source_t transport_data_source; @@ -81,7 +81,7 @@ static void btstack_uart_cts_pulse(void){ } static int btstack_uart_embedded_init(const btstack_uart_config_t * config){ - uart_configuration = config; + btstack_uart_block_configuration = config; hal_uart_dma_set_block_received(&btstack_uart_block_received); hal_uart_dma_set_block_sent(&btstack_uart_block_sent); return 0; @@ -116,7 +116,7 @@ static void btstack_uart_embedded_process(btstack_data_source_t *ds, btstack_dat static int btstack_uart_embedded_open(void){ hal_uart_dma_init(); - hal_uart_dma_set_baud(uart_configuration->baudrate); + hal_uart_dma_set_baud(btstack_uart_block_configuration->baudrate); // set up polling data_source btstack_run_loop_set_data_source_handler(&transport_data_source, &btstack_uart_embedded_process); diff --git a/src/ble/gatt_client.c b/src/ble/gatt_client.c index b780e9a7a..e5a390674 100644 --- a/src/ble/gatt_client.c +++ b/src/ble/gatt_client.c @@ -511,8 +511,8 @@ static void emit_event_new(btstack_packet_handler_t callback, uint8_t * packet, (*callback)(HCI_EVENT_PACKET, 0, packet, size); } -void gatt_client_listen_for_characteristic_value_updates(gatt_client_notification_t * notification, btstack_packet_handler_t packet_handler, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic){ - notification->callback = packet_handler; +void gatt_client_listen_for_characteristic_value_updates(gatt_client_notification_t * notification, btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic){ + notification->callback = callback; notification->con_handle = con_handle; if (characteristic == NULL){ notification->attribute_handle = GATT_CLIENT_ANY_VALUE_HANDLE; @@ -2187,8 +2187,8 @@ uint8_t gatt_client_write_characteristic_descriptor_using_descriptor_handle(btst return ERROR_CODE_SUCCESS; } -uint8_t gatt_client_write_characteristic_descriptor(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_descriptor_t * descriptor, uint16_t length, uint8_t * value){ - return gatt_client_write_characteristic_descriptor_using_descriptor_handle(callback, con_handle, descriptor->handle, length, value); +uint8_t gatt_client_write_characteristic_descriptor(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_descriptor_t * descriptor, uint16_t value_length, uint8_t * value){ + return gatt_client_write_characteristic_descriptor_using_descriptor_handle(callback, con_handle, descriptor->handle, value_length, value); } uint8_t gatt_client_write_long_characteristic_descriptor_using_descriptor_handle_with_offset(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t descriptor_handle, uint16_t offset, uint16_t value_length, uint8_t * value){ diff --git a/src/btstack_uart_block.h b/src/btstack_uart_block.h index 52527ad7c..8d7a23b58 100644 --- a/src/btstack_uart_block.h +++ b/src/btstack_uart_block.h @@ -57,9 +57,9 @@ extern "C" { typedef btstack_uart_t btstack_uart_block_t; // existing block-only implementations -const btstack_uart_t * btstack_uart_block_windows_instance(void); -const btstack_uart_t * btstack_uart_block_embedded_instance(void); -const btstack_uart_t * btstack_uart_block_freertos_instance(void); +const btstack_uart_block_t * btstack_uart_block_windows_instance(void); +const btstack_uart_block_t * btstack_uart_block_embedded_instance(void); +const btstack_uart_block_t * btstack_uart_block_freertos_instance(void); // mapper for extended implementation static inline const btstack_uart_block_t * btstack_uart_block_posix_instance(void){ diff --git a/src/btstack_util.c b/src/btstack_util.c index 1a1818471..631e080ef 100644 --- a/src/btstack_util.c +++ b/src/btstack_util.c @@ -302,9 +302,9 @@ void log_info_key(const char * name, sm_key_t key){ const uint8_t bluetooth_base_uuid[] = { 0x00, 0x00, 0x00, 0x00, /* - */ 0x00, 0x00, /* - */ 0x10, 0x00, /* - */ 0x80, 0x00, /* - */ 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }; -void uuid_add_bluetooth_prefix(uint8_t * uuid128, uint32_t shortUUID){ +void uuid_add_bluetooth_prefix(uint8_t * uuid128, uint32_t short_uuid){ (void)memcpy(uuid128, bluetooth_base_uuid, 16); - big_endian_store_32(uuid128, 0, shortUUID); + big_endian_store_32(uuid128, 0, short_uuid); } int uuid_has_bluetooth_prefix(const uint8_t * uuid128){ diff --git a/src/hci.h b/src/hci.h index 30332a887..2078fe759 100644 --- a/src/hci.h +++ b/src/hci.h @@ -1122,7 +1122,7 @@ void hci_set_inquiry_mode(inquiry_mode_t inquriy_mode); * @param power_mode * @return 0 if success, otherwise error */ -int hci_power_control(HCI_POWER_MODE mode); +int hci_power_control(HCI_POWER_MODE power_mode); /** * @brief Shutdown HCI diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index 53b21ad2c..4faa92e03 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -129,7 +129,7 @@ typedef enum { // UART Driver + Config static const btstack_uart_t * btstack_uart; -static btstack_uart_config_t uart_config; +static btstack_uart_config_t hci_transport_h4_uart_config; // write state static TX_STATE tx_state; @@ -410,17 +410,17 @@ static void hci_transport_h4_init(const void * transport_config){ // extract UART config from transport config hci_transport_config_uart_t * hci_transport_config_uart = (hci_transport_config_uart_t*) transport_config; - uart_config.baudrate = hci_transport_config_uart->baudrate_init; - uart_config.flowcontrol = hci_transport_config_uart->flowcontrol; - uart_config.parity = hci_transport_config_uart->parity; - uart_config.device_name = hci_transport_config_uart->device_name; + hci_transport_h4_uart_config.baudrate = hci_transport_config_uart->baudrate_init; + hci_transport_h4_uart_config.flowcontrol = hci_transport_config_uart->flowcontrol; + hci_transport_h4_uart_config.parity = hci_transport_config_uart->parity; + hci_transport_h4_uart_config.device_name = hci_transport_config_uart->device_name; // set state to off tx_state = TX_OFF; h4_state = H4_OFF; // setup UART driver - btstack_uart->init(&uart_config); + btstack_uart->init(&hci_transport_h4_uart_config); btstack_uart->set_block_received(&hci_transport_h4_block_read); btstack_uart->set_block_sent(&hci_transport_h4_block_sent); } diff --git a/src/l2cap.h b/src/l2cap.h index 5a0c11cee..70049c2bc 100644 --- a/src/l2cap.h +++ b/src/l2cap.h @@ -635,7 +635,7 @@ uint8_t l2cap_le_create_channel(btstack_packet_handler_t packet_handler, hci_con * @param local_cid L2CAP LE Data Channel Identifier * @param credits Number additional credits for peer */ -uint8_t l2cap_le_provide_credits(uint16_t cid, uint16_t credits); +uint8_t l2cap_le_provide_credits(uint16_t local_cid, uint16_t credits); /** * @brief Check if packet can be scheduled for transmission