From a997575e66cd5c16e0bf68fbaaaf6192ceebcbd3 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Wed, 3 Oct 2018 09:43:29 +0200 Subject: [PATCH] pts: clean compile warnings --- test/pts/Makefile | 2 +- test/pts/ble_central_test.c | 13 ++++++++++--- test/pts/bnep_test.c | 8 +++++--- test/pts/gatt_profiles.c | 9 +++++++-- test/pts/hsp_ag_test.c | 5 +++++ test/pts/hsp_hs_test.c | 6 +++++- test/pts/sco_loopback.c | 7 ++++++- 7 files changed, 39 insertions(+), 11 deletions(-) diff --git a/test/pts/Makefile b/test/pts/Makefile index b0a1e2d04..48ed88080 100644 --- a/test/pts/Makefile +++ b/test/pts/Makefile @@ -129,7 +129,7 @@ AVDTP_OBJ = $(AVDTP:.c=.o) HXCMOD_PLAYER_OBJ = ${HXCMOD_PLAYER:.c=.o} EXAMPLES = iopt ble_peripheral_test ble_central_test l2cap_test classic_test bnep_test hsp_ag_test hsp_hs_test sco_loopback le_data_channel -EXAMPLES += avdtp_source_test avdtp_sink_test le_data_channel avrcp_controller_test sm_test avrcp_target_test gatt_profiles hrp_col_test hrp_server_test +EXAMPLES += avdtp_source_test avdtp_sink_test avrcp_controller_test sm_test avrcp_target_test gatt_profiles hrp_col_test hrp_server_test EXAMPLES += hog_demo_test hid_device_test hid_host_test all: ${EXAMPLES} diff --git a/test/pts/ble_central_test.c b/test/pts/ble_central_test.c index f0c5ac374..4f72c1672 100644 --- a/test/pts/ble_central_test.c +++ b/test/pts/ble_central_test.c @@ -253,6 +253,7 @@ const char * ad_event_types[] = { }; static void handle_advertising_event(uint8_t * packet, int size){ + UNUSED(size); // filter PTS bd_addr_t addr; gap_event_advertising_report_get_address(packet, addr); @@ -320,6 +321,7 @@ static void gap_run(void){ } static void app_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ + UNUSED(channel); uint16_t aHandle; bd_addr_t event_address; @@ -430,7 +432,8 @@ static void extract_characteristic(gatt_client_characteristic_t * characteristic } static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ - + UNUSED(channel); + UNUSED(size); if (packet_type != HCI_EVENT_PACKET) return; uint8_t address_type; @@ -1624,6 +1627,8 @@ static void stdin_process(char c){ } static int get_oob_data_callback(uint8_t addres_type, bd_addr_t addr, uint8_t * oob_data){ + UNUSED(addres_type); + (void)addr; switch(sm_have_oob_data){ case 1: memcpy(oob_data, sm_oob_data_A, 16); @@ -1641,7 +1646,8 @@ static int get_oob_data_callback(uint8_t addres_type, bd_addr_t addr, uint8_t * // - if buffer != NULL, copy data and return number bytes copied // @param offset defines start of attribute value static uint16_t att_read_callback(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size){ - + UNUSED(con_handle); + UNUSED(attribute_handle); printf("READ Callback, handle %04x, offset %u, buffer size %u\n", handle, offset, buffer_size); uint16_t att_value_len; @@ -1661,7 +1667,8 @@ static uint16_t att_read_callback(hci_con_handle_t con_handle, uint16_t attribut int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ - + UNUSED(argc); + (void)argv; printf("BTstack LE Peripheral starting up...\n"); memset(rows, 0, sizeof(char *) * 100); diff --git a/test/pts/bnep_test.c b/test/pts/bnep_test.c index c406ae4a2..10e22f385 100644 --- a/test/pts/bnep_test.c +++ b/test/pts/bnep_test.c @@ -658,8 +658,9 @@ static void stdin_process(char c){ } /*************** PANU client routines *********************/ -static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) -{ +static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ + UNUSED(channel); + uint8_t event; bd_addr_t event_addr; bd_addr_t src_addr; @@ -810,7 +811,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ - + UNUSED(argc); + (void)argv; /* Register for HCI events */ hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration); diff --git a/test/pts/gatt_profiles.c b/test/pts/gatt_profiles.c index 111b1f7f9..ff98d025f 100644 --- a/test/pts/gatt_profiles.c +++ b/test/pts/gatt_profiles.c @@ -74,7 +74,6 @@ /* LISTING_START(MainConfiguration): Init L2CAP SM ATT Server and start heartbeat timer */ static int le_notification_enabled; static btstack_packet_callback_registration_t hci_event_callback_registration; -static hci_con_handle_t con_handle; static uint8_t battery = 100; static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); @@ -114,6 +113,10 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack // @param offset defines start of attribute value static uint16_t att_read_callback(hci_con_handle_t connection_handle, uint16_t att_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size){ UNUSED(connection_handle); + UNUSED(att_handle); + UNUSED(offset); + UNUSED(buffer); + UNUSED(buffer_size); // if (att_handle == ATT_CHARACTERISTIC_0000FF11_0000_1000_8000_00805F9B34FB_01_VALUE_HANDLE){ // return att_read_callback_handle_blob((const uint8_t *)counter_string, buffer_size, offset, buffer, buffer_size); @@ -133,10 +136,12 @@ static uint16_t att_read_callback(hci_con_handle_t connection_handle, uint16_t a /* LISTING_START(attWrite): ATT Write */ static int att_write_callback(hci_con_handle_t connection_handle, uint16_t att_handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size){ + UNUSED(connection_handle); + UNUSED(att_handle); UNUSED(transaction_mode); UNUSED(offset); + UNUSED(buffer); UNUSED(buffer_size); - // if (att_handle != ATT_CHARACTERISTIC_0000FF11_0000_1000_8000_00805F9B34FB_01_CLIENT_CONFIGURATION_HANDLE) return 0; // le_notification_enabled = little_endian_read_16(buffer, 0) == GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION; // con_handle = connection_handle; diff --git a/test/pts/hsp_ag_test.c b/test/pts/hsp_ag_test.c index f80b8bb59..92167a75a 100644 --- a/test/pts/hsp_ag_test.c +++ b/test/pts/hsp_ag_test.c @@ -152,6 +152,9 @@ static void stdin_process(char buffer){ // Audio Gateway routines static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ + UNUSED(packet_type); + UNUSED(channel); + UNUSED(event_size); switch (event[2]) { case HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE: if (event[3] == 0){ @@ -187,6 +190,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ + UNUSED(argc); + (void) argv; l2cap_init(); rfcomm_init(); diff --git a/test/pts/hsp_hs_test.c b/test/pts/hsp_hs_test.c index c6ef0bfa9..fac2495d5 100644 --- a/test/pts/hsp_hs_test.c +++ b/test/pts/hsp_hs_test.c @@ -156,6 +156,9 @@ static void stdin_process(char buffer){ } static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ + UNUSED(packet_type); + UNUSED(channel); + UNUSED(event_size); // printf("Packet handler event 0x%02x\n", event[0]); switch (event[0]) { case BTSTACK_EVENT_STATE: @@ -208,7 +211,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ - + UNUSED(argc); + (void)argv; l2cap_init(); rfcomm_init(); diff --git a/test/pts/sco_loopback.c b/test/pts/sco_loopback.c index 1f4a73b64..bb5906823 100644 --- a/test/pts/sco_loopback.c +++ b/test/pts/sco_loopback.c @@ -76,6 +76,9 @@ static void try_send_sco(void){ } static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * packet, uint16_t event_size){ + UNUSED(packet_type); + UNUSED(channel); + UNUSED(event_size); switch (packet[0]) { case BTSTACK_EVENT_STATE: if (btstack_event_state_get_state(packet) != HCI_STATE_WORKING) break; @@ -96,7 +99,9 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack int btstack_main(int argc, const char * argv[]); int btstack_main(int argc, const char * argv[]){ - + UNUSED(argc); + (void)argv; + hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration);