diff --git a/example/a2dp_sink_demo.c b/example/a2dp_sink_demo.c index 75963490b..5f8be9a1f 100644 --- a/example/a2dp_sink_demo.c +++ b/example/a2dp_sink_demo.c @@ -624,12 +624,9 @@ static void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t static void avrcp_controller_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ UNUSED(channel); UNUSED(size); - uint8_t status = 0xFF; if (packet_type != HCI_EVENT_PACKET) return; if (hci_event_packet_get_type(packet) != HCI_EVENT_AVRCP_META) return; - - status = packet[5]; if (!avrcp_cid) return; memset(avrcp_subevent_value, 0, sizeof(avrcp_subevent_value)); @@ -714,9 +711,7 @@ static void avrcp_controller_packet_handler(uint8_t packet_type, uint16_t channe printf("AVRCP Controller: Set Player App Value %s\n", avrcp_ctype2str(avrcp_subevent_player_application_value_response_get_command_type(packet))); break; - default: - printf("AVRCP Controller: Event 0x%02x is not parsed\n", packet[2]); break; } } diff --git a/example/a2dp_source_demo.c b/example/a2dp_source_demo.c index 15d60cc0a..8e6140c3f 100644 --- a/example/a2dp_source_demo.c +++ b/example/a2dp_source_demo.c @@ -833,12 +833,9 @@ static void avrcp_target_packet_handler(uint8_t packet_type, uint16_t channel, u static void avrcp_controller_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ UNUSED(channel); UNUSED(size); - uint8_t status = 0xFF; if (packet_type != HCI_EVENT_PACKET) return; if (hci_event_packet_get_type(packet) != HCI_EVENT_AVRCP_META) return; - - status = packet[5]; if (!media_tracker.avrcp_cid) return; switch (packet[2]){ diff --git a/platform/posix/btstack_run_loop_posix.c b/platform/posix/btstack_run_loop_posix.c index 1808c808f..e2723c6bd 100644 --- a/platform/posix/btstack_run_loop_posix.c +++ b/platform/posix/btstack_run_loop_posix.c @@ -248,7 +248,8 @@ static void btstack_run_loop_posix_set_timer(btstack_timer_source_t *a, uint32_t static void btstack_run_loop_posix_trigger_pipe(int fd){ if (fd < 0) return; const uint8_t x = (uint8_t) 'x'; - (void) write(fd, &x, 1); + ssize_t bytes_written = write(fd, &x, 1); + UNUSED(bytes_written); } // poll data sources from irq @@ -256,7 +257,8 @@ static void btstack_run_loop_posix_trigger_pipe(int fd){ static void btstack_run_loop_posix_poll_data_sources_handler(btstack_data_source_t * ds, btstack_data_source_callback_type_t callback_type){ UNUSED(callback_type); uint8_t buffer[1]; - (void) read(ds->source.fd, buffer, 1); + ssize_t bytes_read = read(ds->source.fd, buffer, 1); + UNUSED(bytes_read); // poll data sources btstack_run_loop_base_poll_data_sources(); } @@ -271,7 +273,8 @@ static void btstack_run_loop_posix_poll_data_sources_from_irq(void){ static void btstack_run_loop_posix_process_callbacks_handler(btstack_data_source_t * ds, btstack_data_source_callback_type_t callback_type){ UNUSED(callback_type); uint8_t buffer[1]; - (void) read(ds->source.fd, buffer, 1); + ssize_t bytes_read = read(ds->source.fd, buffer, 1); + UNUSED(bytes_read); // execute callbacks - protect list with mutex while (1){ pthread_mutex_lock(&btstack_run_loop_posix_callbacks_mutex); diff --git a/platform/posix/btstack_signal.c b/platform/posix/btstack_signal.c index e92af8d68..aac84fda7 100644 --- a/platform/posix/btstack_signal.c +++ b/platform/posix/btstack_signal.c @@ -37,6 +37,9 @@ #define BTSTACK_FILE__ "btstack_signal.c" +// enable System V signal API +#define _POSIX_C_SOURCE 200809 + #include "btstack_signal.h" #include diff --git a/platform/posix/hci_dump_posix_fs.c b/platform/posix/hci_dump_posix_fs.c index 876f9f2fd..952ce68d6 100644 --- a/platform/posix/hci_dump_posix_fs.c +++ b/platform/posix/hci_dump_posix_fs.c @@ -73,7 +73,8 @@ static char log_message_buffer[256]; static void hci_dump_posix_fs_reset(void){ btstack_assert(dump_file >= 0); (void) lseek(dump_file, 0, SEEK_SET); - (void) ftruncate(dump_file, 0); + int err = ftruncate(dump_file, 0); + UNUSED(err); } static void hci_dump_posix_fs_log_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t len) { @@ -117,8 +118,11 @@ static void hci_dump_posix_fs_log_packet(uint8_t packet_type, uint8_t in, uint8_ return; } - (void) write(dump_file, &header, header_len); - (void) write(dump_file, packet, len ); + ssize_t bytes_written; + bytes_written = write(dump_file, &header, header_len); + UNUSED(bytes_written); + bytes_written = write(dump_file, packet, len ); + UNUSED(bytes_written); } static void hci_dump_posix_fs_log_message(const char * format, va_list argptr){ @@ -152,7 +156,8 @@ int hci_dump_posix_fs_open(const char *filename, hci_dump_format_t format){ // Datalink Type: 1001 - Un-encapsulated HCI 0x00, 0x00, 0x03, 0xE9, }; - (void) write(dump_file, &file_header, sizeof(file_header)); + ssize_t bytes_written = write(dump_file, &file_header, sizeof(file_header)); + UNUSED(bytes_written); } return 0; } diff --git a/src/hci_cmd.h b/src/hci_cmd.h index c385ad8f0..6c9f9b369 100644 --- a/src/hci_cmd.h +++ b/src/hci_cmd.h @@ -511,7 +511,6 @@ extern const hci_cmd_t hci_le_set_default_periodic_advertising_sync_transfer_par extern const hci_cmd_t hci_le_set_default_phy; extern const hci_cmd_t hci_le_set_event_mask; extern const hci_cmd_t hci_le_set_extended_advertising_data; -extern const hci_cmd_t hci_le_set_extended_advertising_data; extern const hci_cmd_t hci_le_set_extended_advertising_enable; extern const hci_cmd_t hci_le_set_extended_advertising_parameters; extern const hci_cmd_t hci_le_set_extended_scan_enable; diff --git a/src/mesh/mesh_proxy.c b/src/mesh/mesh_proxy.c index dd1fff2ba..9a33dcdf8 100644 --- a/src/mesh/mesh_proxy.c +++ b/src/mesh/mesh_proxy.c @@ -339,7 +339,6 @@ static mesh_network_pdu_t * encrypted_proxy_configuration_ready_to_send; // Used to answer configuration request static uint16_t proxy_configuration_filter_list_len; static mesh_proxy_configuration_filter_type_t proxy_configuration_filter_type; -static uint16_t primary_element_address; static void request_can_send_now_proxy_configuration_callback_handler(mesh_network_pdu_t * network_pdu){ encrypted_proxy_configuration_ready_to_send = network_pdu; diff --git a/src/mesh/provisioning_provisioner.c b/src/mesh/provisioning_provisioner.c index 68db38b6e..63774f98e 100644 --- a/src/mesh/provisioning_provisioner.c +++ b/src/mesh/provisioning_provisioner.c @@ -91,6 +91,7 @@ static uint8_t prov_start_authentication_method; static uint8_t prov_start_authentication_action; static uint8_t prov_start_authentication_size; static uint8_t prov_authentication_string; +// ConfirmationInputs = ProvisioningInvitePDUValue || ProvisioningCapabilitiesPDUValue || ProvisioningStartPDUValue || PublicKeyProvisioner || PublicKeyDevice static uint8_t prov_confirmation_inputs[1 + 11 + 5 + 64 + 64]; static uint8_t confirmation_provisioner[16]; static uint8_t random_provisioner[16]; @@ -99,8 +100,6 @@ static uint8_t remote_ec_q[64]; static uint8_t dhkey[32]; static uint8_t confirmation_salt[16]; static uint8_t confirmation_key[16]; -// ConfirmationInputs = ProvisioningInvitePDUValue || ProvisioningCapabilitiesPDUValue || ProvisioningStartPDUValue || PublicKeyProvisioner || PublicKeyDevice -static uint8_t prov_confirmation_inputs[1 + 11 + 5 + 64 + 64]; static uint8_t provisioning_salt[16]; static uint8_t session_key[16]; static uint8_t session_nonce[16];