pts: clean compile warnings

This commit is contained in:
Milanka Ringwald 2018-10-03 09:43:29 +02:00
parent 38200c1d68
commit a997575e66
7 changed files with 39 additions and 11 deletions

View File

@ -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}

View File

@ -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);

View File

@ -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);

View File

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

View File

@ -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();

View File

@ -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();

View File

@ -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);