From eb8860135e41be4fb7625a602419fbe1fe980e50 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 20 Jan 2016 16:10:07 +0100 Subject: [PATCH] fix missing bstack_ for struct data_source and struct timer. utils->btstack_util --- chipset/csr/bt_control_csr.c | 2 +- example/daemon/l2cap-throughput.c | 2 +- example/embedded/Makefile.inc | 2 +- example/embedded/gatt_battery_query.c | 2 +- example/embedded/gatt_browser.c | 2 +- example/embedded/le_counter.c | 4 ++-- example/embedded/panu_demo.c | 2 +- example/embedded/spp_and_le_counter.c | 2 +- example/embedded/spp_counter.c | 2 +- example/embedded/spp_flowcontrol.c | 2 +- platform/daemon/btstack_client.h | 2 +- platform/daemon/daemon.c | 2 +- platform/daemon/rfcomm_service_db_memory.c | 2 +- platform/daemon/socket_connection.c | 6 +++--- platform/embedded/hci_transport_h4_dma.c | 4 ++-- platform/embedded/hci_transport_h4_ehcill_dma.c | 4 ++-- platform/posix/hci_transport_h4_posix.c | 4 ++-- platform/posix/hci_transport_h5_posix.c | 4 ++-- platform/posix/remote_device_db_fs.c | 2 +- port/arduino/BTstack.cpp | 2 +- port/arduino/BTstack.h | 2 +- port/arduino/Makefile | 2 +- port/daemon/src/Makefile.in | 2 +- port/ez430-rf2560/Makefile | 2 +- port/ez430-rf2560/example/ant-test.c | 4 ++-- port/ios/CocoaTouch/include/BTstack/BTDevice.h | 2 +- port/ios/src/Makefile | 2 +- port/ios/src/bt_control_iphone.m | 2 +- port/ios/src/hci_transport_h4_iphone.c | 8 ++++---- port/libusb/hci_transport_h2_libusb.c | 4 ++-- port/msp-exp430f5438-cc2564b/Makefile | 2 +- port/msp-exp430f5438-cc2564b/example/ant-test.c | 4 ++-- port/msp430f5229lp-cc2564b/Makefile | 2 +- port/mtk/hci_transport_h4_mtk.c | 4 ++-- .../app.X/nbproject/Makefile-default.mk | 12 ++++++------ .../pic32-harmony/app.X/nbproject/configurations.xml | 4 ++-- port/stm32-f103rb-nucleo/Makefile | 2 +- port/wiced/wiced.mk | 2 +- src/ble/ad_parser.c | 2 +- src/ble/att.c | 2 +- src/ble/att_db_util.c | 2 +- src/ble/att_dispatch.h | 2 +- src/ble/gatt_client.c | 2 +- src/ble/le_device_db.h | 2 +- src/ble/sm.h | 2 +- src/btstack.h | 2 +- src/btstack_control.h | 2 +- src/btstack_run_loop.h | 6 +++--- src/{utils.c => btstack_util.c} | 4 ++-- src/{utils.h => btstack_util.h} | 2 +- src/classic/bnep.c | 2 +- src/classic/bnep.h | 2 +- src/classic/remote_device_db.h | 2 +- src/classic/remote_device_db_memory.c | 2 +- src/classic/rfcomm.c | 4 ++-- src/classic/rfcomm.h | 2 +- src/classic/sdp_client.h | 2 +- src/classic/sdp_parser.h | 2 +- src/classic/sdp_query_rfcomm.h | 2 +- src/classic/sdp_util.c | 2 +- src/gap.h | 2 +- src/hci.h | 2 +- src/l2cap.h | 2 +- src/l2cap_signaling.h | 2 +- test/att_db/Makefile | 2 +- test/att_db/att_db_util_test.c | 2 +- test/ble_client/Makefile | 2 +- test/des_iterator/Makefile | 2 +- test/gatt_client/Makefile | 2 +- test/hfp/Makefile | 4 ++-- test/pts/ble_central_test.c | 2 +- test/pts/ble_peripheral_test.c | 4 ++-- test/pts/bnep_test.c | 2 +- test/pts/classic_test.c | 2 +- test/pts/hfp_ag_test.c | 2 +- test/pts/hfp_hf_test.c | 2 +- test/pts/hsp_ag_test.c | 2 +- test/pts/hsp_hs_test.c | 2 +- test/pts/iopt.c | 2 +- test/pts/l2cap_test.c | 2 +- test/remote_device_db/Makefile | 4 ++-- test/sdp_client/Makefile | 2 +- test/security_manager/Makefile | 2 +- test/security_manager/security_manager.c | 2 +- 84 files changed, 111 insertions(+), 111 deletions(-) rename src/{utils.c => btstack_util.c} (99%) rename src/{utils.h => btstack_util.h} (99%) diff --git a/chipset/csr/bt_control_csr.c b/chipset/csr/bt_control_csr.c index 8698be020..ddba16590 100644 --- a/chipset/csr/bt_control_csr.c +++ b/chipset/csr/bt_control_csr.c @@ -50,7 +50,7 @@ #include "btstack_control.h" #include "btstack_debug.h" -#include "utils.h" +#include "btstack_util.h" // minimal CSR init script to configure PSKEYs and activate them static const uint8_t init_script[] = { diff --git a/example/daemon/l2cap-throughput.c b/example/daemon/l2cap-throughput.c index c53cb6bb0..97442aee0 100644 --- a/example/daemon/l2cap-throughput.c +++ b/example/daemon/l2cap-throughput.c @@ -71,7 +71,7 @@ void prepare_packet(void){ for (i=4;i #include "btstack_run_loop.h" #include "hci_cmds.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack-config.h" #include "btstack_debug.h" diff --git a/example/embedded/gatt_browser.c b/example/embedded/gatt_browser.c index 423bb1060..4e0e8a81b 100644 --- a/example/embedded/gatt_browser.c +++ b/example/embedded/gatt_browser.c @@ -57,7 +57,7 @@ #include #include "btstack_run_loop.h" #include "hci_cmds.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack-config.h" diff --git a/example/embedded/le_counter.c b/example/embedded/le_counter.c index 6b2446fc0..0d5ea91b7 100644 --- a/example/embedded/le_counter.c +++ b/example/embedded/le_counter.c @@ -89,7 +89,7 @@ static btstack_timer_source_t heartbeat; static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); static uint16_t att_read_callback(uint16_t con_handle, uint16_t att_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size); static int att_write_callback(uint16_t con_handle, uint16_t att_handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size); -static void heartbeat_handler(struct timer *ts); +static void heartbeat_handler(struct btstack_timer_source *ts); const uint8_t adv_data[] = { // Flags general discoverable @@ -161,7 +161,7 @@ static int counter = 0; static char counter_string[30]; static int counter_string_len; -static void heartbeat_handler(struct timer *ts){ +static void heartbeat_handler(struct btstack_timer_source *ts){ if (le_notification_enabled) { counter++; counter_string_len = sprintf(counter_string, "BTstack counter %04u", counter); diff --git a/example/embedded/panu_demo.c b/example/embedded/panu_demo.c index fd26ae96c..1bd62854e 100644 --- a/example/embedded/panu_demo.c +++ b/example/embedded/panu_demo.c @@ -269,7 +269,7 @@ static int tap_alloc(char *dev, bd_addr_t bd_addr) */ /* LISTING_START(processTapData): Process incoming network packets */ -static int process_tap_dev_data(struct data_source *ds) +static int process_tap_dev_data(struct btstack_data_source *ds) { ssize_t len; len = read(ds->fd, network_buffer, sizeof(network_buffer)); diff --git a/example/embedded/spp_and_le_counter.c b/example/embedded/spp_and_le_counter.c index 8259fcb61..4875eca2b 100644 --- a/example/embedded/spp_and_le_counter.c +++ b/example/embedded/spp_and_le_counter.c @@ -212,7 +212,7 @@ static int att_write_callback(uint16_t con_handle, uint16_t att_handle, uint16_t */ /* LISTING_START(heartbeat): Combined Heartbeat handler */ -static void heartbeat_handler(struct timer *ts){ +static void heartbeat_handler(struct btstack_timer_source *ts){ counter++; counter_string_len = sprintf(counter_string, "BTstack counter %04u\n", counter); diff --git a/example/embedded/spp_counter.c b/example/embedded/spp_counter.c index 6afa36190..d68486df2 100644 --- a/example/embedded/spp_counter.c +++ b/example/embedded/spp_counter.c @@ -116,7 +116,7 @@ static void spp_service_setup(void){ /* LISTING_START(PeriodicCounter): Periodic Counter */ static btstack_timer_source_t heartbeat; -static void heartbeat_handler(struct timer *ts){ +static void heartbeat_handler(struct btstack_timer_source *ts){ static int counter = 0; if (rfcomm_channel_id){ diff --git a/example/embedded/spp_flowcontrol.c b/example/embedded/spp_flowcontrol.c index 6219395c2..f531b6c52 100644 --- a/example/embedded/spp_flowcontrol.c +++ b/example/embedded/spp_flowcontrol.c @@ -114,7 +114,7 @@ static void spp_service_setup(void){ static btstack_timer_source_t heartbeat; /* LISTING_START(hbhManual): Heartbeat handler with manual credit management */ -static void heartbeat_handler(struct timer *ts){ +static void heartbeat_handler(struct btstack_timer_source *ts){ if (rfcomm_send_credit){ rfcomm_grant_credits(rfcomm_channel_id, 1); rfcomm_send_credit = 0; diff --git a/platform/daemon/btstack_client.h b/platform/daemon/btstack_client.h index f19f1a757..b011ec112 100644 --- a/platform/daemon/btstack_client.h +++ b/platform/daemon/btstack_client.h @@ -50,7 +50,7 @@ #include "hci_cmds.h" #include "daemon_cmds.h" #include "btstack_run_loop.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack-config.h" diff --git a/platform/daemon/daemon.c b/platform/daemon/daemon.c index 69d0df992..7ba64f5ef 100644 --- a/platform/daemon/daemon.c +++ b/platform/daemon/daemon.c @@ -259,7 +259,7 @@ static void dummy_bluetooth_status_handler(BLUETOOTH_STATE state){ log_info("Bluetooth status: %u\n", state); }; -static void daemon_no_connections_timeout(struct timer *ts){ +static void daemon_no_connections_timeout(struct btstack_timer_source *ts){ if (clients_require_power_on()) return; // false alarm :) log_info("No active client connection for %u seconds -> POWER OFF\n", DAEMON_NO_ACTIVE_CLIENT_TIMEOUT/1000); hci_power_control(HCI_POWER_OFF); diff --git a/platform/daemon/rfcomm_service_db_memory.c b/platform/daemon/rfcomm_service_db_memory.c index 9c624fb9f..fd2fac542 100644 --- a/platform/daemon/rfcomm_service_db_memory.c +++ b/platform/daemon/rfcomm_service_db_memory.c @@ -42,7 +42,7 @@ #include "btstack_memory.h" #include "btstack_debug.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack_linked_list.h" // This lists should be only accessed by tests. diff --git a/platform/daemon/socket_connection.c b/platform/daemon/socket_connection.c index 5b09e3f84..699233a58 100644 --- a/platform/daemon/socket_connection.c +++ b/platform/daemon/socket_connection.c @@ -92,7 +92,7 @@ struct sockaddr_un { #define MAX_PENDING_CONNECTIONS 10 /** prototypes */ -static int socket_connection_hci_process(struct data_source *ds); +static int socket_connection_hci_process(struct btstack_data_source *ds); static int socket_connection_dummy_handler(connection_t *connection, uint16_t packet_type, uint16_t channel, uint8_t *data, uint16_t length); /** globals */ @@ -201,7 +201,7 @@ void static socket_connection_emit_nr_connections(void){ // log_info("Nr connections changed,.. new %u", nr_connections); } -int socket_connection_hci_process(struct data_source *ds) { +int socket_connection_hci_process(struct btstack_data_source *ds) { connection_t *conn = (connection_t *) ds; int bytes_read = read(ds->fd, &conn->buffer[conn->bytes_read], conn->bytes_to_read); @@ -286,7 +286,7 @@ int socket_connection_has_parked_connections(void){ return parked != NULL; } -static int socket_connection_accept(struct data_source *socket_ds) { +static int socket_connection_accept(struct btstack_data_source *socket_ds) { struct sockaddr_storage ss; socklen_t slen = sizeof(ss); diff --git a/platform/embedded/hci_transport_h4_dma.c b/platform/embedded/hci_transport_h4_dma.c index 9767092f1..64f41105b 100644 --- a/platform/embedded/hci_transport_h4_dma.c +++ b/platform/embedded/hci_transport_h4_dma.c @@ -79,7 +79,7 @@ typedef struct hci_transport_h4 { } hci_transport_h4_t; // prototypes -static int h4_process(struct data_source *ds); +static int h4_process(struct btstack_data_source *ds); static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size); static void h4_block_received(void); static void h4_block_sent(void); @@ -236,7 +236,7 @@ static void h4_register_packet_handler(void (*handler)(uint8_t packet_type, uint packet_handler = handler; } -static int h4_process(struct data_source *ds) { +static int h4_process(struct btstack_data_source *ds) { // notify about packet sent if (tx_state == TX_DONE){ diff --git a/platform/embedded/hci_transport_h4_ehcill_dma.c b/platform/embedded/hci_transport_h4_ehcill_dma.c index 75f60edde..e949fdc50 100644 --- a/platform/embedded/hci_transport_h4_ehcill_dma.c +++ b/platform/embedded/hci_transport_h4_ehcill_dma.c @@ -102,7 +102,7 @@ typedef struct hci_transport_h4 { } hci_transport_h4_t; // prototypes -static int h4_process(struct data_source *ds); +static int h4_process(struct btstack_data_source *ds); static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size); static void h4_block_received(void); static void h4_block_sent(void); @@ -390,7 +390,7 @@ static void h4_block_sent(void){ } } -static int h4_process(struct data_source *ds) { +static int h4_process(struct btstack_data_source *ds) { // reset tx state before emitting packet sent event // to allow for positive can_send_now diff --git a/platform/posix/hci_transport_h4_posix.c b/platform/posix/hci_transport_h4_posix.c index 6b10f5ad0..4186c5a53 100644 --- a/platform/posix/hci_transport_h4_posix.c +++ b/platform/posix/hci_transport_h4_posix.c @@ -61,7 +61,7 @@ #error HCI_OUTGOING_PRE_BUFFER_SIZE not defined. Please update hci.h #endif -static int h4_process(struct data_source *ds); +static int h4_process(struct btstack_data_source *ds); static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size); typedef enum { @@ -310,7 +310,7 @@ static void h4_statemachine(void){ } } -static int h4_process(struct data_source *ds) { +static int h4_process(struct btstack_data_source *ds) { if (hci_transport_h4->uart_fd == 0) return -1; int read_now = bytes_to_read; diff --git a/platform/posix/hci_transport_h5_posix.c b/platform/posix/hci_transport_h5_posix.c index 8802ac36b..ce9e6e3a0 100644 --- a/platform/posix/hci_transport_h5_posix.c +++ b/platform/posix/hci_transport_h5_posix.c @@ -79,7 +79,7 @@ static int bt_filedesc = 0; // single instance static hci_transport_h5_t * hci_transport_h5 = NULL; -static int h5_process(struct data_source *ds); +static int h5_process(struct btstack_data_source *ds); static void dummy_handler(uint8_t packet_type, uint8_t *packet, int size); static void (*packet_handler)(uint8_t packet_type, uint8_t *packet, int size) = dummy_handler; @@ -281,7 +281,7 @@ static void h5_slip_process( h5_slip_t * sm, uint8_t input, uint8_t in){ } -static int h5_process(struct data_source *ds) { +static int h5_process(struct btstack_data_source *ds) { if (hci_transport_h5->ds->fd == 0) return -1; // read up to bytes_to_read data in diff --git a/platform/posix/remote_device_db_fs.c b/platform/posix/remote_device_db_fs.c index 54e883cdf..8b27bf331 100644 --- a/platform/posix/remote_device_db_fs.c +++ b/platform/posix/remote_device_db_fs.c @@ -43,7 +43,7 @@ #include "classic/remote_device_db.h" #include "btstack_debug.h" -#include "utils.h" +#include "btstack_util.h" #define LINK_KEY_PATH "/tmp/" #define LINK_KEY_PREFIX "btstack_link_key_" diff --git a/port/arduino/BTstack.cpp b/port/arduino/BTstack.cpp index 11433f635..492703c32 100644 --- a/port/arduino/BTstack.cpp +++ b/port/arduino/BTstack.cpp @@ -19,7 +19,7 @@ #include "hal_tick.h" #include "hal_cpu.h" #include "hci_cmds.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack_run_loop.h" #include "btstack_run_loop_embedded.h" #include "classic/sdp_util.h" diff --git a/port/arduino/BTstack.h b/port/arduino/BTstack.h index 93b9a2350..75012f6aa 100644 --- a/port/arduino/BTstack.h +++ b/port/arduino/BTstack.h @@ -4,7 +4,7 @@ #pragma once #include "ble/att.h" -#include "utils.h" +#include "btstack_util.h" #include "ble/gatt_client.h" #include "hci.h" #include diff --git a/port/arduino/Makefile b/port/arduino/Makefile index ed85ce361..c4b80312b 100644 --- a/port/arduino/Makefile +++ b/port/arduino/Makefile @@ -10,7 +10,7 @@ BTSTACK_PACKAGE=/tmp/btstack ARCHIVE=btstack-arduino-${VERSION}.zip SRC_FILES = btstack_memory.c btstack_linked_list.c btstack_memory_pool.c run_loop.c -SRC_FILES += hci_dump.c hci.c hci_cmds.c utils.c l2cap.c +SRC_FILES += hci_dump.c hci.c hci_cmds.c btstack_util.c l2cap.c BLE_FILES = ad_parser.c att.c att_server.c att_dispatch.c att_db_util.c le_device_db_memory.c gatt_client.c BLE_FILES += sm.c ancs_client_lib.h ancs_client_lib.c PORT_FILES = btstack-config.h bsp_arduino_em9301.cpp BTstack.cpp BTstack.h diff --git a/port/daemon/src/Makefile.in b/port/daemon/src/Makefile.in index 2936bef57..b53582af5 100644 --- a/port/daemon/src/Makefile.in +++ b/port/daemon/src/Makefile.in @@ -33,7 +33,7 @@ libBTstack_SOURCES = \ btstack_linked_list.c \ btstack_run_loop.c \ sdp_util.c \ - utils.c \ + btstack_util.c \ $(btstack_run_loop_sources) \ BTdaemon_SOURCES = \ diff --git a/port/ez430-rf2560/Makefile b/port/ez430-rf2560/Makefile index aafdf7232..ec0d887cb 100644 --- a/port/ez430-rf2560/Makefile +++ b/port/ez430-rf2560/Makefile @@ -47,7 +47,7 @@ CORE = \ btstack_memory_pool.c \ btstack_run_loop.c \ btstack_run_loop_embedded.c \ - utils.c \ + btstack_util.c \ COMMON = \ hal_uart_dma.c \ diff --git a/port/ez430-rf2560/example/ant-test.c b/port/ez430-rf2560/example/ant-test.c index 3278a08ff..4fa98b8fe 100644 --- a/port/ez430-rf2560/example/ant-test.c +++ b/port/ez430-rf2560/example/ant-test.c @@ -60,7 +60,7 @@ #include "hci_cmds.h" #include "btstack_run_loop.h" #include "classic/sdp_util.h" -#include "utils.h" +#include "btstack_util.h" #include "hci.h" #include "l2cap.h" @@ -193,7 +193,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack } } -static void heartbeat_handler(struct timer *ts){ +static void heartbeat_handler(struct btstack_timer_source *ts){ if (rfcomm_channel_id){ static int counter = 0; diff --git a/port/ios/CocoaTouch/include/BTstack/BTDevice.h b/port/ios/CocoaTouch/include/BTstack/BTDevice.h index d22ac5a2b..16dc629db 100644 --- a/port/ios/CocoaTouch/include/BTstack/BTDevice.h +++ b/port/ios/CocoaTouch/include/BTstack/BTDevice.h @@ -36,7 +36,7 @@ // #import -#include "utils.h" +#include "btstack_util.h" #define kCODHID 0x2540 #define kCODZeeMote 0x584 diff --git a/port/ios/src/Makefile b/port/ios/src/Makefile index 317b2fe6f..29c13a18d 100644 --- a/port/ios/src/Makefile +++ b/port/ios/src/Makefile @@ -27,7 +27,7 @@ libBTstack_FILES = \ hci_dump.c \ sdp_util.c \ socket_connection.c \ - utils.c \ + btstack_util.c \ libBTstack_CFLAGS = -I$(BTSTACK_ROOT)/src/ble -I$(BTSTACK_ROOT)/src -I.. diff --git a/port/ios/src/bt_control_iphone.m b/port/ios/src/bt_control_iphone.m index 10f66b649..618359d26 100644 --- a/port/ios/src/bt_control_iphone.m +++ b/port/ios/src/bt_control_iphone.m @@ -707,7 +707,7 @@ static void MySleepCallBack( void * refCon, io_service_t service, natural_t mess } } -static int power_notification_process(struct data_source *ds) { +static int power_notification_process(struct btstack_data_source *ds) { if (!power_notification_callback) return -1; diff --git a/port/ios/src/hci_transport_h4_iphone.c b/port/ios/src/hci_transport_h4_iphone.c index c66307cb5..84f128b94 100644 --- a/port/ios/src/hci_transport_h4_iphone.c +++ b/port/ios/src/hci_transport_h4_iphone.c @@ -82,13 +82,13 @@ #include "hci.h" #include "hci_transport.h" -static int h4_process(struct data_source *ds); +static int h4_process(struct btstack_data_source *ds); static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size); static hci_transport_config_uart_t *hci_transport_config_uart; static void h4_enforce_wake_on(void); static void h4_enforce_wake_off(void); -static void h4_enforce_wake_timeout(struct timer *ts); +static void h4_enforce_wake_timeout(struct btstack_timer_source *ts); typedef enum { H4_W4_PACKET_TYPE, @@ -317,7 +317,7 @@ static void h4_statemachine(void){ } } -static int h4_process(struct data_source *ds) { +static int h4_process(struct btstack_data_source *ds) { if (hci_transport_h4->uart_fd == 0) return -1; int read_now = bytes_to_read; @@ -362,7 +362,7 @@ static void h4_enforce_wake_off(void) } } -static void h4_enforce_wake_timeout(struct timer *ts) +static void h4_enforce_wake_timeout(struct btstack_timer_source *ts) { h4_enforce_wake_off(); } diff --git a/port/libusb/hci_transport_h2_libusb.c b/port/libusb/hci_transport_h2_libusb.c index b3a0b7d04..66854f246 100644 --- a/port/libusb/hci_transport_h2_libusb.c +++ b/port/libusb/hci_transport_h2_libusb.c @@ -388,7 +388,7 @@ static void handle_completed_transfer(struct libusb_transfer *transfer){ } } -static int usb_process_ds(struct data_source *ds) { +static int usb_process_ds(struct btstack_data_source *ds) { if (libusb_state != LIB_USB_TRANSFERS_ALLOCATED) return -1; // log_info("begin usb_process_ds"); @@ -425,7 +425,7 @@ static void usb_process_ts(btstack_timer_source_t *timer) { if (libusb_state != LIB_USB_TRANSFERS_ALLOCATED) return; // actually handled the packet in the pollfds function - usb_process_ds((struct data_source *) NULL); + usb_process_ds((struct btstack_data_source *) NULL); // Get the amount of time until next event is due long msec = AYSNC_POLLING_INTERVAL_MS; diff --git a/port/msp-exp430f5438-cc2564b/Makefile b/port/msp-exp430f5438-cc2564b/Makefile index f933ff29c..c4a1574ca 100644 --- a/port/msp-exp430f5438-cc2564b/Makefile +++ b/port/msp-exp430f5438-cc2564b/Makefile @@ -47,7 +47,7 @@ CORE = \ hal_usb.c \ hci_dump.c \ main.c \ - utils.c \ + btstack_util.c \ COMMON = \ hal_uart_dma.c \ diff --git a/port/msp-exp430f5438-cc2564b/example/ant-test.c b/port/msp-exp430f5438-cc2564b/example/ant-test.c index c6d18084a..7d5745a3c 100644 --- a/port/msp-exp430f5438-cc2564b/example/ant-test.c +++ b/port/msp-exp430f5438-cc2564b/example/ant-test.c @@ -60,7 +60,7 @@ #include "hci_cmds.h" #include "btstack_run_loop.h" #include "classic/sdp_util.h" -#include "utils.h" +#include "btstack_util.h" #include "hci.h" #include "l2cap.h" @@ -193,7 +193,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack } } -static void heartbeat_handler(struct timer *ts){ +static void heartbeat_handler(struct btstack_timer_source *ts){ if (rfcomm_channel_id){ static int counter = 0; diff --git a/port/msp430f5229lp-cc2564b/Makefile b/port/msp430f5229lp-cc2564b/Makefile index 349b15de5..446a58cfe 100644 --- a/port/msp430f5229lp-cc2564b/Makefile +++ b/port/msp430f5229lp-cc2564b/Makefile @@ -49,7 +49,7 @@ CORE = \ hci_dump.c \ linked_list.c \ main.c \ - utils.c \ + btstack_util.c \ COMMON = \ hal_uart_dma.c \ diff --git a/port/mtk/hci_transport_h4_mtk.c b/port/mtk/hci_transport_h4_mtk.c index 93f173ece..26f668b78 100644 --- a/port/mtk/hci_transport_h4_mtk.c +++ b/port/mtk/hci_transport_h4_mtk.c @@ -54,7 +54,7 @@ #include "hci.h" #include "hci_transport.h" -static int h4_process(struct data_source *ds); +static int h4_process(struct btstack_data_source *ds); static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size); typedef struct hci_transport_h4 { @@ -121,7 +121,7 @@ static void h4_register_packet_handler(void (*handler)(uint8_t packet_type, ui packet_handler = handler; } -static int h4_process(struct data_source *ds) { +static int h4_process(struct btstack_data_source *ds) { if (hci_transport_h4->ds->fd == 0) return -1; // read up to bytes_to_read data in diff --git a/port/pic32-harmony/app.X/nbproject/Makefile-default.mk b/port/pic32-harmony/app.X/nbproject/Makefile-default.mk index 9aa22c465..41afce96d 100644 --- a/port/pic32-harmony/app.X/nbproject/Makefile-default.mk +++ b/port/pic32-harmony/app.X/nbproject/Makefile-default.mk @@ -45,7 +45,7 @@ OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} # Source Files Quoted if spaced -SOURCEFILES_QUOTED_IF_SPACED=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../src/bnep.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmds.c ../../../src/hci_dump.c ../../../src/hci_transport_h4_dma.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/linked_list.c ../../../src/btstack_memory_pool.c ../../../src/pan.c ../../../src/remote_device_db_memory.c ../../../src/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/btstack_run_loop_embedded.c ../../../src/sdp.c ../../../src/sdp_client.c ../../../src/sdp_parser.c ../../../src/sdp_query_rfcomm.c ../../../src/sdp_query_util.c ../../../src/sdp_util.c ../../../src/utils.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c ../../../chipset/csr/bt_control_csr.c ../../../ble/ad_parser.c ../../../ble/att.c ../../../ble/att_dispatch.c ../../../ble/att_server.c ../../../ble/le_device_db_memory.c ../../../ble/sm.c ../../../example/embedded/spp_and_le_counter.c +SOURCEFILES_QUOTED_IF_SPACED=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../src/bnep.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmds.c ../../../src/hci_dump.c ../../../src/hci_transport_h4_dma.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/linked_list.c ../../../src/btstack_memory_pool.c ../../../src/pan.c ../../../src/remote_device_db_memory.c ../../../src/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/btstack_run_loop_embedded.c ../../../src/sdp.c ../../../src/sdp_client.c ../../../src/sdp_parser.c ../../../src/sdp_query_rfcomm.c ../../../src/sdp_query_util.c ../../../src/sdp_util.c ../../../src/btstack_util.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c ../../../chipset/csr/bt_control_csr.c ../../../ble/ad_parser.c ../../../ble/att.c ../../../ble/att_dispatch.c ../../../ble/att_server.c ../../../ble/le_device_db_memory.c ../../../ble/sm.c ../../../example/embedded/spp_and_le_counter.c # Object Files Quoted if spaced OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/1386528437/bnep.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmds.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4_dma.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/linked_list.o ${OBJECTDIR}/_ext/1386528437/memory_pool.o ${OBJECTDIR}/_ext/1386528437/pan.o ${OBJECTDIR}/_ext/1386528437/remote_device_db_memory.o ${OBJECTDIR}/_ext/1386528437/rfcomm.o ${OBJECTDIR}/_ext/1386528437/run_loop.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/1386528437/sdp.o ${OBJECTDIR}/_ext/1386528437/sdp_client.o ${OBJECTDIR}/_ext/1386528437/sdp_parser.o ${OBJECTDIR}/_ext/1386528437/sdp_query_rfcomm.o ${OBJECTDIR}/_ext/1386528437/sdp_query_util.o ${OBJECTDIR}/_ext/1386528437/sdp_util.o ${OBJECTDIR}/_ext/1386528437/utils.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ${OBJECTDIR}/_ext/1768124388/bt_control_csr.o ${OBJECTDIR}/_ext/1386511916/ad_parser.o ${OBJECTDIR}/_ext/1386511916/att.o ${OBJECTDIR}/_ext/1386511916/att_dispatch.o ${OBJECTDIR}/_ext/1386511916/att_server.o ${OBJECTDIR}/_ext/1386511916/le_device_db_memory.o ${OBJECTDIR}/_ext/1386511916/sm.o ${OBJECTDIR}/_ext/350421922/spp_and_le_counter.o @@ -55,7 +55,7 @@ POSSIBLE_DEPFILES=${OBJECTDIR}/_ext/2048875307/system_init.o.d ${OBJECTDIR}/_ext OBJECTFILES=${OBJECTDIR}/_ext/2048875307/system_init.o ${OBJECTDIR}/_ext/2048875307/system_tasks.o ${OBJECTDIR}/_ext/1360937237/btstack_port.o ${OBJECTDIR}/_ext/1360937237/app_debug.o ${OBJECTDIR}/_ext/1360937237/app.o ${OBJECTDIR}/_ext/1360937237/main.o ${OBJECTDIR}/_ext/1386528437/bnep.o ${OBJECTDIR}/_ext/1386528437/btstack_memory.o ${OBJECTDIR}/_ext/1386528437/hci.o ${OBJECTDIR}/_ext/1386528437/hci_cmds.o ${OBJECTDIR}/_ext/1386528437/hci_dump.o ${OBJECTDIR}/_ext/1386528437/hci_transport_h4_dma.o ${OBJECTDIR}/_ext/1386528437/l2cap.o ${OBJECTDIR}/_ext/1386528437/l2cap_signaling.o ${OBJECTDIR}/_ext/1386528437/linked_list.o ${OBJECTDIR}/_ext/1386528437/memory_pool.o ${OBJECTDIR}/_ext/1386528437/pan.o ${OBJECTDIR}/_ext/1386528437/remote_device_db_memory.o ${OBJECTDIR}/_ext/1386528437/rfcomm.o ${OBJECTDIR}/_ext/1386528437/run_loop.o ${OBJECTDIR}/_ext/1386528437/btstack_run_loop_embedded.o ${OBJECTDIR}/_ext/1386528437/sdp.o ${OBJECTDIR}/_ext/1386528437/sdp_client.o ${OBJECTDIR}/_ext/1386528437/sdp_parser.o ${OBJECTDIR}/_ext/1386528437/sdp_query_rfcomm.o ${OBJECTDIR}/_ext/1386528437/sdp_query_util.o ${OBJECTDIR}/_ext/1386528437/sdp_util.o ${OBJECTDIR}/_ext/1386528437/utils.o ${OBJECTDIR}/_ext/1880736137/drv_tmr.o ${OBJECTDIR}/_ext/1112166103/sys_clk.o ${OBJECTDIR}/_ext/1112166103/sys_clk_pic32mx.o ${OBJECTDIR}/_ext/1510368962/sys_devcon.o ${OBJECTDIR}/_ext/1510368962/sys_devcon_pic32mx.o ${OBJECTDIR}/_ext/2087176412/sys_int_pic32.o ${OBJECTDIR}/_ext/2147153351/sys_ports.o ${OBJECTDIR}/_ext/1768124388/bt_control_csr.o ${OBJECTDIR}/_ext/1386511916/ad_parser.o ${OBJECTDIR}/_ext/1386511916/att.o ${OBJECTDIR}/_ext/1386511916/att_dispatch.o ${OBJECTDIR}/_ext/1386511916/att_server.o ${OBJECTDIR}/_ext/1386511916/le_device_db_memory.o ${OBJECTDIR}/_ext/1386511916/sm.o ${OBJECTDIR}/_ext/350421922/spp_and_le_counter.o # Source Files -SOURCEFILES=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../src/bnep.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmds.c ../../../src/hci_dump.c ../../../src/hci_transport_h4_dma.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/linked_list.c ../../../src/btstack_memory_pool.c ../../../src/pan.c ../../../src/remote_device_db_memory.c ../../../src/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/btstack_run_loop_embedded.c ../../../src/sdp.c ../../../src/sdp_client.c ../../../src/sdp_parser.c ../../../src/sdp_query_rfcomm.c ../../../src/sdp_query_util.c ../../../src/sdp_util.c ../../../src/utils.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c ../../../chipset/csr/bt_control_csr.c ../../../ble/ad_parser.c ../../../ble/att.c ../../../ble/att_dispatch.c ../../../ble/att_server.c ../../../ble/le_device_db_memory.c ../../../ble/sm.c ../../../example/embedded/spp_and_le_counter.c +SOURCEFILES=../src/system_config/bk-audio-dk/system_init.c ../src/system_config/bk-audio-dk/system_tasks.c ../src/btstack_port.c ../src/app_debug.c ../src/app.c ../src/main.c ../../../src/bnep.c ../../../src/btstack_memory.c ../../../src/hci.c ../../../src/hci_cmds.c ../../../src/hci_dump.c ../../../src/hci_transport_h4_dma.c ../../../src/l2cap.c ../../../src/l2cap_signaling.c ../../../src/linked_list.c ../../../src/btstack_memory_pool.c ../../../src/pan.c ../../../src/remote_device_db_memory.c ../../../src/rfcomm.c ../../../src/btstack_run_loop.c ../../../src/btstack_run_loop_embedded.c ../../../src/sdp.c ../../../src/sdp_client.c ../../../src/sdp_parser.c ../../../src/sdp_query_rfcomm.c ../../../src/sdp_query_util.c ../../../src/sdp_util.c ../../../src/btstack_util.c ../../../../driver/tmr/src/dynamic/drv_tmr.c ../../../../system/clk/src/sys_clk.c ../../../../system/clk/src/sys_clk_pic32mx.c ../../../../system/devcon/src/sys_devcon.c ../../../../system/devcon/src/sys_devcon_pic32mx.c ../../../../system/int/src/sys_int_pic32.c ../../../../system/ports/src/sys_ports.c ../../../chipset/csr/bt_control_csr.c ../../../ble/ad_parser.c ../../../ble/att.c ../../../ble/att_dispatch.c ../../../ble/att_server.c ../../../ble/le_device_db_memory.c ../../../ble/sm.c ../../../example/embedded/spp_and_le_counter.c CFLAGS= @@ -256,11 +256,11 @@ ${OBJECTDIR}/_ext/1386528437/sdp_util.o: ../../../src/sdp_util.c nbproject/Make @${RM} ${OBJECTDIR}/_ext/1386528437/sdp_util.o @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/sdp_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -MMD -MF "${OBJECTDIR}/_ext/1386528437/sdp_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/sdp_util.o ../../../src/sdp_util.c -${OBJECTDIR}/_ext/1386528437/utils.o: ../../../src/utils.c nbproject/Makefile-${CND_CONF}.mk +${OBJECTDIR}/_ext/1386528437/utils.o: ../../../src/btstack_util.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/utils.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/utils.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/utils.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -MMD -MF "${OBJECTDIR}/_ext/1386528437/utils.o.d" -o ${OBJECTDIR}/_ext/1386528437/utils.o ../../../src/utils.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/utils.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -MMD -MF "${OBJECTDIR}/_ext/1386528437/utils.o.d" -o ${OBJECTDIR}/_ext/1386528437/utils.o ../../../src/btstack_util.c ${OBJECTDIR}/_ext/1880736137/drv_tmr.o: ../../../../driver/tmr/src/dynamic/drv_tmr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1880736137" @@ -515,11 +515,11 @@ ${OBJECTDIR}/_ext/1386528437/sdp_util.o: ../../../src/sdp_util.c nbproject/Make @${RM} ${OBJECTDIR}/_ext/1386528437/sdp_util.o @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/sdp_util.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -MMD -MF "${OBJECTDIR}/_ext/1386528437/sdp_util.o.d" -o ${OBJECTDIR}/_ext/1386528437/sdp_util.o ../../../src/sdp_util.c -${OBJECTDIR}/_ext/1386528437/utils.o: ../../../src/utils.c nbproject/Makefile-${CND_CONF}.mk +${OBJECTDIR}/_ext/1386528437/utils.o: ../../../src/btstack_util.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1386528437" @${RM} ${OBJECTDIR}/_ext/1386528437/utils.o.d @${RM} ${OBJECTDIR}/_ext/1386528437/utils.o - @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/utils.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -MMD -MF "${OBJECTDIR}/_ext/1386528437/utils.o.d" -o ${OBJECTDIR}/_ext/1386528437/utils.o ../../../src/utils.c + @${FIXDEPS} "${OBJECTDIR}/_ext/1386528437/utils.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -Os -I"." -I"../../../.." -I"../src" -I"../src/system_config/bk-audio-dk" -I"../../../include" -I"../../../src" -I"../../../ble" -I"../../../chipset/csr" -MMD -MF "${OBJECTDIR}/_ext/1386528437/utils.o.d" -o ${OBJECTDIR}/_ext/1386528437/utils.o ../../../src/btstack_util.c ${OBJECTDIR}/_ext/1880736137/drv_tmr.o: ../../../../driver/tmr/src/dynamic/drv_tmr.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} "${OBJECTDIR}/_ext/1880736137" diff --git a/port/pic32-harmony/app.X/nbproject/configurations.xml b/port/pic32-harmony/app.X/nbproject/configurations.xml index 47ca7e5d7..31ecc2b18 100644 --- a/port/pic32-harmony/app.X/nbproject/configurations.xml +++ b/port/pic32-harmony/app.X/nbproject/configurations.xml @@ -38,7 +38,7 @@ ../../../src/btstack_linked_list.h ../../../src/btstack_memory_pool.h ../../../src/run_loop.h - ../../../src/utils.h + ../../../src/btstack_util.h ../../../src/bnep.h ../../../src/bt_control.h ../../../src/btstack_memory.h @@ -139,7 +139,7 @@ ../../../src/classic/sdp_query_rfcomm.c ../../../src/classic/sdp_query_util.c ../../../src/classic/sdp_util.c - ../../../src/utils.c + ../../../src/btstack_util.c diff --git a/port/stm32-f103rb-nucleo/Makefile b/port/stm32-f103rb-nucleo/Makefile index 1b7b26d70..d561d764a 100644 --- a/port/stm32-f103rb-nucleo/Makefile +++ b/port/stm32-f103rb-nucleo/Makefile @@ -36,7 +36,7 @@ COMMON = \ rfcomm.c \ sdp.c \ sdp_util.c \ - utils.c \ + btstack_util.c \ sdp_parser.c \ sdp_client.c \ sdp_query_util.c \ diff --git a/port/wiced/wiced.mk b/port/wiced/wiced.mk index 1cd8cb97b..0df5321f0 100644 --- a/port/wiced/wiced.mk +++ b/port/wiced/wiced.mk @@ -35,7 +35,7 @@ $(NAME)_SOURCES += \ ../../src/l2cap_signaling.c \ ../../src/btstack_memory_pool.c \ ../../src/run_loop.c \ - ../../src/utils.c \ + ../../src/btstack_util.c \ # WICED port incl. support for Broadcom chipset $(NAME)_SOURCES += \ diff --git a/src/ble/ad_parser.c b/src/ble/ad_parser.c index 932c5fa0b..1336e3f8b 100644 --- a/src/ble/ad_parser.c +++ b/src/ble/ad_parser.c @@ -47,7 +47,7 @@ #include #include -#include "utils.h" +#include "btstack_util.h" #include "classic/sdp_util.h" #include "hci_cmds.h" diff --git a/src/ble/att.c b/src/ble/att.c index 81fdce83f..380b575de 100644 --- a/src/ble/att.c +++ b/src/ble/att.c @@ -42,7 +42,7 @@ #include "bluetooth.h" #include "ble/att.h" #include "btstack_debug.h" -#include "utils.h" +#include "btstack_util.h" // Buetooth Base UUID 00000000-0000-1000-8000-00805F9B34FB in little endian static const uint8_t bluetooth_base_uuid[] = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; diff --git a/src/ble/att_db_util.c b/src/ble/att_db_util.c index 1b01f1245..f281a5a41 100644 --- a/src/ble/att_db_util.c +++ b/src/ble/att_db_util.c @@ -40,7 +40,7 @@ #include "att_db_util.h" #include "ble/att.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack_debug.h" #include "bluetooth.h" diff --git a/src/ble/att_dispatch.h b/src/ble/att_dispatch.h index f7e294ea4..16e4bb3ab 100644 --- a/src/ble/att_dispatch.h +++ b/src/ble/att_dispatch.h @@ -43,7 +43,7 @@ #ifndef __ATT_DISPATCH_H #define __ATT_DISPATCH_H -#include "utils.h" +#include "btstack_util.h" #if defined __cplusplus extern "C" { diff --git a/src/ble/gatt_client.c b/src/ble/gatt_client.c index 5f35b3a69..388994d06 100644 --- a/src/ble/gatt_client.c +++ b/src/ble/gatt_client.c @@ -41,7 +41,7 @@ #include #include "btstack_run_loop.h" #include "hci_cmds.h" -#include "utils.h" +#include "btstack_util.h" #include "classic/sdp_util.h" #include "btstack-config.h" diff --git a/src/ble/le_device_db.h b/src/ble/le_device_db.h index be3ecbf3e..5e2117499 100644 --- a/src/ble/le_device_db.h +++ b/src/ble/le_device_db.h @@ -38,7 +38,7 @@ #ifndef __LE_DEVICE_DB_H #define __LE_DEVICE_DB_H -#include "utils.h" +#include "btstack_util.h" #if defined __cplusplus extern "C" { diff --git a/src/ble/sm.h b/src/ble/sm.h index 157805a65..a0848be37 100644 --- a/src/ble/sm.h +++ b/src/ble/sm.h @@ -39,7 +39,7 @@ #define __SM_H #include -#include "utils.h" +#include "btstack_util.h" #if defined __cplusplus extern "C" { diff --git a/src/btstack.h b/src/btstack.h index 0f026eba9..7392453a5 100644 --- a/src/btstack.h +++ b/src/btstack.h @@ -62,7 +62,7 @@ #include "btstack_linked_list.h" #include "btstack_memory_pool.h" #include "btstack_run_loop.h" -#include "utils.h" +#include "btstack_util.h" #include "version.h" #ifdef HAVE_BLE diff --git a/src/btstack_control.h b/src/btstack_control.h index dfc5f072c..a67e5a100 100644 --- a/src/btstack_control.h +++ b/src/btstack_control.h @@ -48,7 +48,7 @@ #define __BT_CONTROL_H #include -#include "utils.h" +#include "btstack_util.h" #if defined __cplusplus extern "C" { diff --git a/src/btstack_run_loop.h b/src/btstack_run_loop.h index f69f91074..51daeba45 100644 --- a/src/btstack_run_loop.h +++ b/src/btstack_run_loop.h @@ -61,10 +61,10 @@ extern "C" { typedef struct btstack_data_source { btstack_linked_item_t item; int fd; // <-- file descriptor to watch or 0 - int (*process)(struct data_source *ds); // <-- do processing + int (*process)(struct btstack_data_source *ds); // <-- do processing } btstack_data_source_t; -typedef struct btstack_timer { +typedef struct btstack_timer_source { btstack_linked_item_t item; #ifdef HAVE_TIME struct timeval timeout; // <-- next timeout @@ -72,7 +72,7 @@ typedef struct btstack_timer { #if defined(HAVE_TICK) || defined(HAVE_TIME_MS) uint32_t timeout; // timeout in system ticks (HAVE_TICK) or millis (HAVE_TIME_MS) #endif - void (*process)(struct timer *ts); // <-- do processing + void (*process)(struct btstack_timer_source *ts); // <-- do processing } btstack_timer_source_t; // diff --git a/src/utils.c b/src/btstack_util.c similarity index 99% rename from src/utils.c rename to src/btstack_util.c index 25ca3a2d8..3b4677ffe 100644 --- a/src/utils.c +++ b/src/btstack_util.c @@ -36,7 +36,7 @@ */ /* - * utils.c + * btstack_util.c * * General utility functions * @@ -44,7 +44,7 @@ */ #include "btstack-config.h" -#include "utils.h" +#include "btstack_util.h" #include #include #include "btstack_debug.h" diff --git a/src/utils.h b/src/btstack_util.h similarity index 99% rename from src/utils.h rename to src/btstack_util.h index 082de93cf..3e0bf5232 100644 --- a/src/utils.h +++ b/src/btstack_util.h @@ -36,7 +36,7 @@ */ /* - * utils.h + * btstack_util.h * * General utility functions * diff --git a/src/classic/bnep.c b/src/classic/bnep.c index 53a970c71..30601f5bf 100644 --- a/src/classic/bnep.c +++ b/src/classic/bnep.c @@ -47,7 +47,7 @@ #include #include "hci_cmds.h" -#include "utils.h" +#include "btstack_util.h" #include "classic/sdp_util.h" #include "btstack_memory.h" diff --git a/src/classic/bnep.h b/src/classic/bnep.h index bc08b7cf5..3699aa8be 100644 --- a/src/classic/bnep.h +++ b/src/classic/bnep.h @@ -44,7 +44,7 @@ #ifndef __BNEP_H #define __BNEP_H -#include "utils.h" +#include "btstack_util.h" #include diff --git a/src/classic/remote_device_db.h b/src/classic/remote_device_db.h index a7544bd0e..e05affac6 100644 --- a/src/classic/remote_device_db.h +++ b/src/classic/remote_device_db.h @@ -42,7 +42,7 @@ #ifndef __REMOTE_DEVICE_DB_H #define __REMOTE_DEVICE_DB_H -#include "utils.h" +#include "btstack_util.h" #include "gap.h" #if defined __cplusplus diff --git a/src/classic/remote_device_db_memory.c b/src/classic/remote_device_db_memory.c index 72ee82a84..247125c6e 100644 --- a/src/classic/remote_device_db_memory.c +++ b/src/classic/remote_device_db_memory.c @@ -42,7 +42,7 @@ #include "btstack_memory.h" #include "btstack_debug.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack_linked_list.h" // This lists should be only accessed by tests. diff --git a/src/classic/rfcomm.c b/src/classic/rfcomm.c index 706c14e4d..b65ec4ccc 100644 --- a/src/classic/rfcomm.c +++ b/src/classic/rfcomm.c @@ -45,9 +45,9 @@ #include #include "hci_cmds.h" -#include "utils.h" +#include "btstack_util.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack_memory.h" #include "hci.h" #include "hci_dump.h" diff --git a/src/classic/rfcomm.h b/src/classic/rfcomm.h index 5d92fb09e..52f699ee8 100644 --- a/src/classic/rfcomm.h +++ b/src/classic/rfcomm.h @@ -42,7 +42,7 @@ #ifndef __RFCOMM_H #define __RFCOMM_H -#include "utils.h" +#include "btstack_util.h" #include diff --git a/src/classic/sdp_client.h b/src/classic/sdp_client.h index f9bb97766..fa79bd13a 100644 --- a/src/classic/sdp_client.h +++ b/src/classic/sdp_client.h @@ -44,7 +44,7 @@ #include "btstack-config.h" -#include "utils.h" +#include "btstack_util.h" #if defined __cplusplus extern "C" { diff --git a/src/classic/sdp_parser.h b/src/classic/sdp_parser.h index 5b00839ad..370d63c57 100644 --- a/src/classic/sdp_parser.h +++ b/src/classic/sdp_parser.h @@ -50,7 +50,7 @@ #include #include "classic/sdp_util.h" -#include "utils.h" +#include "btstack_util.h" #if defined __cplusplus extern "C" { diff --git a/src/classic/sdp_query_rfcomm.h b/src/classic/sdp_query_rfcomm.h index 23ced5009..53c98bd70 100644 --- a/src/classic/sdp_query_rfcomm.h +++ b/src/classic/sdp_query_rfcomm.h @@ -42,7 +42,7 @@ #ifndef __SDP_QUERY_RFCOMM_H #define __SDP_QUERY_RFCOMM_H -#include "utils.h" +#include "btstack_util.h" #include "classic/sdp_parser.h" #include "classic/sdp_query_util.h" diff --git a/src/classic/sdp_util.c b/src/classic/sdp_util.c index 4170e8251..54238d2c4 100644 --- a/src/classic/sdp_util.c +++ b/src/classic/sdp_util.c @@ -40,7 +40,7 @@ */ #include "classic/sdp_util.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack-config.h" #include "bluetooth.h" diff --git a/src/gap.h b/src/gap.h index 6f742b381..b59bf3f62 100644 --- a/src/gap.h +++ b/src/gap.h @@ -43,7 +43,7 @@ extern "C" { #endif #include "btstack_defines.h" -#include "utils.h" +#include "btstack_util.h" typedef enum { diff --git a/src/hci.h b/src/hci.h index 724653ead..7e8699342 100644 --- a/src/hci.h +++ b/src/hci.h @@ -53,7 +53,7 @@ #include "hci_cmds.h" #include "hci_transport.h" #include "btstack_linked_list.h" -#include "utils.h" +#include "btstack_util.h" #include #include diff --git a/src/l2cap.h b/src/l2cap.h index 92408b10c..0a9c382bc 100644 --- a/src/l2cap.h +++ b/src/l2cap.h @@ -48,7 +48,7 @@ #include "hci.h" #include "l2cap_signaling.h" -#include "utils.h" +#include "btstack_util.h" #include "bluetooth.h" #if defined __cplusplus diff --git a/src/l2cap_signaling.h b/src/l2cap_signaling.h index 4e9d4feb2..81901090c 100644 --- a/src/l2cap_signaling.h +++ b/src/l2cap_signaling.h @@ -46,7 +46,7 @@ #include #include -#include "utils.h" +#include "btstack_util.h" #include "hci_cmds.h" #if defined __cplusplus diff --git a/test/att_db/Makefile b/test/att_db/Makefile index 0335e312d..6a6d2049f 100644 --- a/test/att_db/Makefile +++ b/test/att_db/Makefile @@ -16,7 +16,7 @@ VPATH += ${BTSTACK_ROOT}/src/ble VPATH += ${BTSTACK_ROOT}/platform/posix COMMON = \ - utils.c \ + btstack_util.c \ hci_dump.c \ att_db_util.c \ diff --git a/test/att_db/att_db_util_test.c b/test/att_db/att_db_util_test.c index cae913ca2..78751a4c6 100644 --- a/test/att_db/att_db_util_test.c +++ b/test/att_db/att_db_util_test.c @@ -52,7 +52,7 @@ #include "ble/att.h" #include "ble/att_db_util.h" -#include "utils.h" +#include "btstack_util.h" #include "bluetooth.h" #include "le_counter.h" diff --git a/test/ble_client/Makefile b/test/ble_client/Makefile index 73ba0d828..afc8c2124 100644 --- a/test/ble_client/Makefile +++ b/test/ble_client/Makefile @@ -21,7 +21,7 @@ COMMON = \ btstack_memory_pool.c \ run_loop.c \ btstack_run_loop_posix.c \ - utils.c \ + btstack_util.c \ COMMON_OBJ = $(COMMON:.c=.o) diff --git a/test/des_iterator/Makefile b/test/des_iterator/Makefile index 0a4e0d6fb..1e08655e2 100644 --- a/test/des_iterator/Makefile +++ b/test/des_iterator/Makefile @@ -14,7 +14,7 @@ VPATH += ${BTSTACK_ROOT}/platform/posix COMMON = \ sdp_util.c \ hci_dump.c \ - utils.c + btstack_util.c COMMON_OBJ = $(COMMON:.c=.o) diff --git a/test/gatt_client/Makefile b/test/gatt_client/Makefile index ad1a951e9..06c31d66e 100644 --- a/test/gatt_client/Makefile +++ b/test/gatt_client/Makefile @@ -23,7 +23,7 @@ COMMON = \ le_device_db_memory.c \ btstack_memory_pool.c \ mock.c \ - utils.c \ + btstack_util.c \ COMMON_OBJ = $(COMMON:.c=.o) diff --git a/test/hfp/Makefile b/test/hfp/Makefile index 9e27202e7..c4ff1a425 100644 --- a/test/hfp/Makefile +++ b/test/hfp/Makefile @@ -26,7 +26,7 @@ COMMON = \ sdp_parser.c \ sdp_query_util.c \ sdp_util.c \ - utils.c \ + btstack_util.c \ MOCK = \ @@ -39,7 +39,7 @@ MOCK = \ btstack_memory_pool.c \ remote_device_db_memory.c \ sdp_util.c \ - utils.c \ + btstack_util.c \ COMMON_OBJ = $(COMMON:.c=.o) MOCK_OBJ = $(MOCK:.c=.o) diff --git a/test/pts/ble_central_test.c b/test/pts/ble_central_test.c index f61dc779b..f33de3459 100644 --- a/test/pts/ble_central_test.c +++ b/test/pts/ble_central_test.c @@ -1603,7 +1603,7 @@ static void ui_process_command(char buffer){ } } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ char buffer; read(ds->fd, &buffer, 1); diff --git a/test/pts/ble_peripheral_test.c b/test/pts/ble_peripheral_test.c index 4e0a7d694..a8dad45a3 100644 --- a/test/pts/ble_peripheral_test.c +++ b/test/pts/ble_peripheral_test.c @@ -262,7 +262,7 @@ static int att_attribute_for_handle(uint16_t aHandle){ } -static void heartbeat_handler(struct timer *ts){ +static void heartbeat_handler(struct btstack_timer_source *ts){ // restart timer btstack_run_loop_set_timer(ts, HEARTBEAT_PERIOD_MS); btstack_run_loop_add_timer(ts); @@ -711,7 +711,7 @@ static void update_auth_req(void){ sm_set_authentication_requirements(auth_req); } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ char buffer; read(ds->fd, &buffer, 1); diff --git a/test/pts/bnep_test.c b/test/pts/bnep_test.c index 851c90301..2501a6696 100644 --- a/test/pts/bnep_test.c +++ b/test/pts/bnep_test.c @@ -566,7 +566,7 @@ static void show_usage(void){ printf("---\n"); } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ char buffer; read(ds->fd, &buffer, 1); diff --git a/test/pts/classic_test.c b/test/pts/classic_test.c index ba0a7af0e..a754c117e 100644 --- a/test/pts/classic_test.c +++ b/test/pts/classic_test.c @@ -471,7 +471,7 @@ static void show_usage(void){ printf("---\n"); } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ char buffer; read(ds->fd, &buffer, 1); diff --git a/test/pts/hfp_ag_test.c b/test/pts/hfp_ag_test.c index 2950b37a1..59a456c9f 100644 --- a/test/pts/hfp_ag_test.c +++ b/test/pts/hfp_ag_test.c @@ -349,7 +349,7 @@ static void show_usage(void){ printf("---\n"); } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ read(ds->fd, &cmd, 1); switch (cmd){ case 'a': diff --git a/test/pts/hfp_hf_test.c b/test/pts/hfp_hf_test.c index 8ee0790e2..7faaa8648 100644 --- a/test/pts/hfp_hf_test.c +++ b/test/pts/hfp_hf_test.c @@ -173,7 +173,7 @@ static void show_usage(void){ printf("---\n"); } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ read(ds->fd, &cmd, 1); if (cmd >= '0' && cmd <= '9'){ diff --git a/test/pts/hsp_ag_test.c b/test/pts/hsp_ag_test.c index a9e01a4d5..64675d5b1 100644 --- a/test/pts/hsp_ag_test.c +++ b/test/pts/hsp_ag_test.c @@ -94,7 +94,7 @@ static void show_usage(void){ printf("---\n"); } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ char buffer; read(ds->fd, &buffer, 1); diff --git a/test/pts/hsp_hs_test.c b/test/pts/hsp_hs_test.c index b648880fa..6bbae9e63 100644 --- a/test/pts/hsp_hs_test.c +++ b/test/pts/hsp_hs_test.c @@ -193,7 +193,7 @@ static void show_usage(void){ printf("---\n"); } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ char buffer; read(ds->fd, &buffer, 1); diff --git a/test/pts/iopt.c b/test/pts/iopt.c index 942ea16a7..8c8a260e3 100644 --- a/test/pts/iopt.c +++ b/test/pts/iopt.c @@ -65,7 +65,7 @@ static void show_usage(void){ printf("---\n"); } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ char buffer; read(ds->fd, &buffer, 1); switch (buffer){ diff --git a/test/pts/l2cap_test.c b/test/pts/l2cap_test.c index d2e2bffce..bfbf804fe 100644 --- a/test/pts/l2cap_test.c +++ b/test/pts/l2cap_test.c @@ -118,7 +118,7 @@ static void show_usage(void){ printf("---\n"); } -static int stdin_process(struct data_source *ds){ +static int stdin_process(struct btstack_data_source *ds){ char buffer; read(ds->fd, &buffer, 1); switch (buffer){ diff --git a/test/remote_device_db/Makefile b/test/remote_device_db/Makefile index f0f143efc..6d0358977 100644 --- a/test/remote_device_db/Makefile +++ b/test/remote_device_db/Makefile @@ -17,13 +17,13 @@ VPATH += ${BTSTACK_ROOT}/src VPATH += ${BTSTACK_ROOT}/platform/posix FS = \ - utils.c \ + btstack_util.c \ hci_dump.c \ remote_device_db_fs.c MEMORY = \ - utils.c \ + btstack_util.c \ btstack_memory_pool.c \ btstack_memory.c \ hci_dump.c \ diff --git a/test/sdp_client/Makefile b/test/sdp_client/Makefile index a474f9886..27a086fd3 100644 --- a/test/sdp_client/Makefile +++ b/test/sdp_client/Makefile @@ -17,7 +17,7 @@ COMMON = \ sdp_util.c \ sdp_parser.c \ hci_dump.c \ - utils.c \ + btstack_util.c \ COMMON_OBJ = $(COMMON:.c=.o) diff --git a/test/security_manager/Makefile b/test/security_manager/Makefile index 7c22e62cc..9023bda2a 100644 --- a/test/security_manager/Makefile +++ b/test/security_manager/Makefile @@ -24,7 +24,7 @@ COMMON = \ mock.c \ rijndael.c \ sm.c \ - utils.c \ + btstack_util.c \ COMMON_OBJ = $(COMMON:.c=.o) diff --git a/test/security_manager/security_manager.c b/test/security_manager/security_manager.c index 43ad7d53b..475c6f10a 100644 --- a/test/security_manager/security_manager.c +++ b/test/security_manager/security_manager.c @@ -17,7 +17,7 @@ #include "btstack_run_loop_posix.h" #include "hci_cmds.h" -#include "utils.h" +#include "btstack_util.h" #include "btstack_memory.h" #include "hci.h"