remove <stdio.h>, <stdlib.h> and printf from most core files

This commit is contained in:
Matthias Ringwald 2020-07-07 22:52:12 +02:00
parent 3573e8a41e
commit 9192020a66
32 changed files with 3 additions and 88 deletions

View File

@ -45,8 +45,6 @@
// *****************************************************************************
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bluetooth_data_types.h"

View File

@ -107,7 +107,6 @@ static uint16_t heart_rate_service_read_callback(hci_con_handle_t con_handle, ui
}
return 1;
}
// printf("heart_rate_service_read_callback, not handeled read on handle 0x%02x\n", attribute_handle);
return 0;
}
@ -122,11 +121,6 @@ static int heart_rate_service_write_callback(hci_con_handle_t con_handle, uint16
}
heart_rate.measurement_client_configuration_descriptor_notify = little_endian_read_16(buffer, 0);
heart_rate.con_handle = con_handle;
// if (heart_rate.measurement_client_configuration_descriptor_notify){
// printf("notify enabled\n");
// } else {
// printf("notify disabled\n");
// }
return 0;
}
@ -142,8 +136,6 @@ static int heart_rate_service_write_callback(hci_con_handle_t con_handle, uint16
}
return 0;
}
// printf("heart_rate_service_write_callback, not handeled write on handle 0x%02x\n", attribute_handle);
return 0;
}
@ -192,7 +184,6 @@ static void heart_rate_service_can_send_now(void * context){
if (instance->rr_interval_count){
flags |= (1 << HEART_RATE_SERVICE_RR_INTERVAL);
}
// printf("heart_rate_service_can_send_now: flags 0%2x\n", flags);
uint8_t value[100];
int pos = 0;
@ -239,8 +230,6 @@ void heart_rate_service_server_update_heart_rate_values(uint16_t heart_rate_bpm,
heart_rate_service_sensor_contact_status_t sensor_contact, int rr_interval_count, uint16_t * rr_intervals){
heart_rate_t * instance = &heart_rate;
// printf("update_heart_rate_values, notify %u con_handle %04x\n", instance->measurement_client_configuration_descriptor_notify, instance->con_handle);
instance->measurement_bpm = heart_rate_bpm;
instance->sensor_contact = sensor_contact;
instance->rr_interval_count = rr_interval_count;

View File

@ -45,8 +45,6 @@
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack_defines.h"

View File

@ -43,7 +43,6 @@
#include "btstack_base64_decoder.h"
#include <string.h>
#include <stdio.h>
/**
* @brief Initialize base99 decoder

View File

@ -45,8 +45,6 @@
#include "btstack_linked_list.h"
#include "btstack_debug.h"
#include <stdlib.h>
#include <stdio.h>
/**
* tests if list is empty

View File

@ -42,8 +42,6 @@
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "btstack_ring_buffer.h"

View File

@ -45,10 +45,6 @@
#include "btstack_run_loop.h"
#include <stdio.h>
#include <stdlib.h> // exit()
#include "btstack_debug.h"
#include "btstack_config.h"

View File

@ -278,7 +278,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
UNUSED(size);
bd_addr_t address;
uint8_t status;
uint8_t signal_identifier;
uint16_t cid;
uint8_t loc_seid;
uint8_t rem_seid;
@ -340,7 +339,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
case AVDTP_SUBEVENT_SIGNALING_REJECT:
case AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT:
signal_identifier = avdtp_subevent_signaling_accept_get_signal_identifier(packet);
cid = avdtp_subevent_signaling_accept_get_avdtp_cid(packet);
loc_seid = avdtp_subevent_signaling_accept_get_local_seid(packet);
a2dp_emit_cmd_rejected(a2dp_sink_context.a2dp_callback, packet, size);

View File

@ -37,8 +37,6 @@
#define BTSTACK_FILE__ "avdtp_acceptor.c"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack.h"

View File

@ -37,10 +37,7 @@
#define BTSTACK_FILE__ "avdtp_util.c"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack.h"

View File

@ -38,8 +38,6 @@
#define BTSTACK_FILE__ "avrcp_browsing_controller.c"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "btstack.h"

View File

@ -38,8 +38,6 @@
#define BTSTACK_FILE__ "avrcp_browsing_target.c"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "btstack.h"
@ -149,7 +147,6 @@ static void avrcp_browsing_target_packet_handler(uint8_t packet_type, uint16_t c
case AVRCP_END_PACKET:
switch(browsing_connection->pdu_id){
case AVRCP_PDU_ID_GET_FOLDER_ITEMS:
printf("\n");
browsing_connection->scope = packet[pos++];
browsing_connection->start_item = big_endian_read_32(packet, pos);
pos += 4;
@ -246,8 +243,7 @@ uint8_t avrcp_browsing_target_send_get_folder_items_response(uint16_t avrcp_brow
}
(void)memcpy(&connection->cmd_operands[pos], attr_list, attr_list_size);
pos += attr_list_size;
connection->cmd_operands_length = pos;
// printf_hexdump(connection->cmd_operands, connection->cmd_operands_length);
connection->cmd_operands_length = pos;
connection->state = AVCTP_W2_SEND_RESPONSE;
avrcp_browsing_request_can_send_now(connection, connection->l2cap_browsing_cid);

View File

@ -38,8 +38,6 @@
#define BTSTACK_FILE__ "avrcp_controller.c"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>

View File

@ -45,8 +45,6 @@
// *****************************************************************************
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "classic/avrcp_media_item_iterator.h"

View File

@ -38,8 +38,6 @@
#define BTSTACK_FILE__ "avrcp_target.c"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
@ -515,8 +513,7 @@ static uint8_t avrcp_target_subunit_info(avrcp_connection_t * connection, uint8_
connection->command_type = AVRCP_CTYPE_RESPONSE_IMPLEMENTED_STABLE;
connection->subunit_type = AVRCP_SUBUNIT_TYPE_UNIT; //vendor unique
connection->subunit_id = AVRCP_SUBUNIT_ID_IGNORE;
// printf("avrcp_target_subunit_info subunit_type %d\n", connection->subunit_type);
uint8_t page = offset / 4;
uint8_t extension_code = 7;
connection->cmd_operands_length = 5;
@ -610,7 +607,6 @@ static uint8_t avrcp_target_store_media_attr(avrcp_connection_t * connection, av
if (!value) return AVRCP_STATUS_INVALID_PARAMETER;
connection->now_playing_info[index].value = (uint8_t*)value;
connection->now_playing_info[index].len = strlen(value);
// printf("store %lu bytes, %s\n", strlen(value), value);
return ERROR_CODE_SUCCESS;
}
@ -914,7 +910,6 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
}
pos += 8;
uint8_t attribute_count = pdu[pos++];
// printf("AVRCP_PDU_ID_GET_ELEMENT_ATTRIBUTES attribute count %d\n", attribute_count);
connection->next_attr_id = AVRCP_MEDIA_ATTR_NONE;
if (!attribute_count){
connection->now_playing_info_attr_bitmap = 0xFE;
@ -1135,7 +1130,6 @@ static void avrcp_target_packet_handler(uint8_t packet_type, uint16_t channel, u
}
else if (connection->notify_volume_percentage_changed){
// printf("emit new volume %d\n", connection->volume_percentage);
connection->notify_volume_percentage_changed = 0;
avrcp_target_send_notification(connection->l2cap_signaling_cid, connection, AVRCP_NOTIFICATION_EVENT_VOLUME_CHANGED, &connection->volume_percentage, 1);
avrcp_target_reset_notification(connection, AVRCP_NOTIFICATION_EVENT_VOLUME_CHANGED);

View File

@ -43,9 +43,7 @@
#include "gatt_sdp.h"
#include <stdio.h>
#include <string.h>
#include "bluetooth_gatt.h"
#include "bluetooth_psm.h"
#include "bluetooth_sdp.h"

View File

@ -40,8 +40,6 @@
#include "btstack_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack_debug.h"

View File

@ -42,8 +42,6 @@
extern "C" {
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -41,8 +41,6 @@
#include "btstack_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
@ -821,7 +819,6 @@ void hfp_handle_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
hfp_connection->rfcomm_cid = rfcomm_event_incoming_connection_get_rfcomm_cid(packet);
hfp_connection->state = HFP_W4_RFCOMM_CONNECTED;
// printf("RFCOMM channel %u requested for %s\n", hfp_connection->rfcomm_cid, bd_addr_to_str(hfp_connection->remote_addr));
rfcomm_accept_connection(hfp_connection->rfcomm_cid);
break;
@ -841,16 +838,13 @@ void hfp_handle_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
hfp_connection->acl_handle = rfcomm_event_channel_opened_get_con_handle(packet);
hfp_connection->rfcomm_cid = rfcomm_event_channel_opened_get_rfcomm_cid(packet);
bd_addr_copy(hfp_connection->remote_addr, event_addr);
// uint16_t mtu = rfcomm_event_channel_opened_get_max_frame_size(packet);
// printf("RFCOMM channel open succeeded. hfp_connection %p, RFCOMM Channel ID 0x%02x, max frame size %u\n", hfp_connection, hfp_connection->rfcomm_cid, mtu);
switch (hfp_connection->state){
case HFP_W4_RFCOMM_CONNECTED:
hfp_connection->state = HFP_EXCHANGE_SUPPORTED_FEATURES;
break;
case HFP_W4_CONNECTION_ESTABLISHED_TO_SHUTDOWN:
hfp_connection->state = HFP_W2_DISCONNECT_RFCOMM;
// printf("Shutting down RFCOMM.\n");
break;
default:
break;

View File

@ -46,8 +46,6 @@
#include "btstack_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hci_cmd.h"

View File

@ -46,8 +46,6 @@
#include "btstack_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack_memory.h"

View File

@ -46,8 +46,6 @@
#include "btstack_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bluetooth_sdp.h"
@ -138,7 +136,6 @@ static void hfp_hf_emit_type_and_number(btstack_packet_handler_t callback, uint8
static void hfp_hf_emit_enhanced_call_status(btstack_packet_handler_t callback, hfp_connection_t * connection){
if (!callback) return;
printf("hfp_hf_emit_enhanced_call_status: %s \n", connection->bnip_number);
uint8_t event[36];
int pos = 0;
event[pos++] = HCI_EVENT_HFP_META;
@ -958,7 +955,6 @@ static void hfp_hf_switch_on_ok(hfp_connection_t *hfp_connection){
switch (hfp_connection->hf_query_operator_state){
case HFP_HF_QUERY_OPERATOR_W4_SET_FORMAT_OK:
// printf("Format set, querying name\n");
hfp_connection->hf_query_operator_state = HFP_HF_QUERY_OPERATOR_SEND_QUERY;
break;
case HPF_HF_QUERY_OPERATOR_W4_RESULT:

View File

@ -46,8 +46,6 @@
#include "btstack_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bluetooth_sdp.h"

View File

@ -46,8 +46,6 @@
#include "btstack_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bluetooth_sdp.h"
@ -474,7 +472,6 @@ static void hsp_run(void){
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
UNUSED(channel); // ok: no channel for HCI_EVENT_PACKET and only single active RFCOMM channel
if (packet_type == RFCOMM_DATA_PACKET){
// printf("packet_handler type RFCOMM_DATA_PACKET %u, packet[0] %x\n", packet_type, packet[0]);
// skip over leading newline
while ((size > 0) && ((packet[0] == '\n') || (packet[0] == '\r'))){
size--;

View File

@ -43,8 +43,6 @@ extern "C" {
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack_defines.h"

View File

@ -45,7 +45,6 @@
#include "pan.h"
#include <stdio.h>
#include <string.h>
#include "bluetooth_psm.h"

View File

@ -40,8 +40,6 @@
#include "btstack_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hci_cmd.h"

View File

@ -41,8 +41,6 @@
* rfcomm.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h> // memcpy
#include <stdint.h>

View File

@ -42,8 +42,6 @@
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bluetooth_sdp.h"

View File

@ -41,7 +41,6 @@
* Implementation of the Service Discovery Protocol Server
*/
#include <stdio.h>
#include <string.h>
#include "bluetooth.h"

View File

@ -63,7 +63,6 @@
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <inttypes.h>
#include "btstack_debug.h"

View File

@ -58,8 +58,6 @@
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
/*
* @brief L2CAP Supervisory function in S-Frames
*/