diff --git a/src/ble/gatt-service/cycling_power_service_server.c b/src/ble/gatt-service/cycling_power_service_server.c index 990239676..6b5b62713 100644 --- a/src/ble/gatt-service/cycling_power_service_server.c +++ b/src/ble/gatt-service/cycling_power_service_server.c @@ -393,7 +393,6 @@ static void cycling_power_service_vector_can_send_now(void * context){ break; } case CP_VECTOR_FLAG_FIRST_CRANK_MEASUREMENT_ANGLE_PRESENT: - // printf("CP_VECTOR_FLAG_FIRST_CRANK_MEASUREMENT_ANGLE_PRESENT \n"); little_endian_store_16(value, pos, instance->vector_first_crank_measurement_angle_deg); pos += 2; break; @@ -572,11 +571,6 @@ static void cycling_power_service_response_can_send_now(void * context){ return; } - // if (instance->w4_indication_complete){ - // printf("cycling_power_service_response_can_send_now: w4_indication_complete\n"); - // return; - // } - // use preprocessor instead of btstack_max to get compile-time constant #if (CP_SENSOR_LOCATION_RESERVED > (CYCLING_POWER_MANUFACTURER_SPECIFIC_DATA_MAX_SIZE + 5)) #define MAX_RESPONSE_PAYLOAD CP_SENSOR_LOCATION_RESERVED @@ -669,8 +663,6 @@ static void cycling_power_service_response_can_send_now(void * context){ uint8_t status = att_server_indicate(instance->con_handle, instance->control_point_value_handle, &value[0], pos); if (status == ERROR_CODE_SUCCESS){ instance->w4_indication_complete = 1; - // printf("cycling_power_service_response_can_send_now: set w4_indication_complete\n"); - // printf("can_send_now set opcode to CP_OPCODE_IDLE\n"); instance->request_opcode = CP_OPCODE_IDLE; } else { log_error("can_send_now failed 0x%2x", status); @@ -686,7 +678,6 @@ static int cycling_power_service_write_callback(hci_con_handle_t con_handle, uin cycling_power_sensor_location_t location; cycling_power_t * instance = &cycling_power; - // printf("cycling_power_service_write_callback: attr handle 0x%02x\n", attribute_handle); if (attribute_handle == instance->measurement_client_configuration_descriptor_handle){ if (buffer_size < 2u){ return ATT_ERROR_INVALID_OFFSET; @@ -860,7 +851,6 @@ static int cycling_power_service_write_callback(hci_con_handle_t con_handle, uin ((has_feature(CP_FEATURE_FLAG_SENSOR_MEASUREMENT_CONTEXT) == CP_SENSOR_MEASUREMENT_CONTEXT_FORCE) || (has_feature(CP_FEATURE_FLAG_SENSOR_MEASUREMENT_CONTEXT) == CP_SENSOR_MEASUREMENT_CONTEXT_TORQUE)) ){ - // printf("start offset compensation procedure, enhanced %d\n", (instance->request_opcode == CP_OPCODE_START_ENHANCED_OFFSET_COMPENSATION)); uint8_t event[7]; int index = 0; event[index++] = HCI_EVENT_GATTSERVICE_META; @@ -934,8 +924,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe instance->con_handle = hci_subevent_le_connection_complete_get_connection_handle(packet); // print connection parameters (without using float operations) instance->con_interval = hci_subevent_le_connection_complete_get_conn_interval(packet); - // printf("Initial Connection Interval: %u, %u.%02u ms\n", instance->con_interval, instance->con_interval * 125 / 100, 25 * (instance->con_interval & 3)); - // printf("Initial Connection Latency: %u\n", hci_subevent_le_connection_complete_get_conn_latency(packet)); instance->con_interval_status = CP_CONNECTION_INTERVAL_STATUS_RECEIVED; break; @@ -1112,7 +1100,6 @@ void cycling_power_service_add_energy(uint16_t energy_kJ){ } else { instance->accumulated_energy_kJ = 0xffff; } - // printf("energy %d\n", instance->accumulated_energy_kJ); } void cycling_power_service_server_set_instantaneous_power(int16_t instantaneous_power_watt){ @@ -1234,7 +1221,6 @@ void cycling_power_service_server_packet_handler(btstack_packet_handler_t callba void cycling_power_server_calibration_done(cycling_power_sensor_measurement_context_t measurement_type, uint16_t calibrated_value){ cycling_power_t * instance = &cycling_power; if (instance->response_value != CP_RESPONSE_VALUE_W4_VALUE_AVAILABLE){ - // printf("cycling_power_server_calibration_done : CP_RESPONSE_VALUE_W4_VALUE_AVAILABLE con_handle 0x%02x\n", instance->con_handle); return; } instance->response_value = CP_RESPONSE_VALUE_SUCCESS; diff --git a/src/ble/gatt-service/cycling_speed_and_cadence_service_server.c b/src/ble/gatt-service/cycling_speed_and_cadence_service_server.c index 320660444..80a8ca863 100644 --- a/src/ble/gatt-service/cycling_speed_and_cadence_service_server.c +++ b/src/ble/gatt-service/cycling_speed_and_cadence_service_server.c @@ -138,7 +138,6 @@ static uint16_t cycling_speed_and_cadence_service_read_callback(hci_con_handle_t static void cycling_speed_and_cadence_service_csc_measurement_can_send_now(void * context){ cycling_speed_and_cadence_t * instance = (cycling_speed_and_cadence_t *) context; if (!instance){ - // printf("instance is null (cycling_speed_and_cadence_service_csc_measurement_can_send_now)\n"); return; } uint8_t flags = (instance->wheel_revolution_data_supported << CSC_FLAG_WHEEL_REVOLUTION_DATA_SUPPORTED); @@ -153,7 +152,6 @@ static void cycling_speed_and_cadence_service_csc_measurement_can_send_now(void pos += 4; little_endian_store_16(value, pos, instance->last_wheel_event_time); pos += 2; - // printf("send cumulative 0x%04x\n", instance->cumulative_wheel_revolutions); } if (instance->crank_revolution_data_supported){ @@ -169,7 +167,6 @@ static void cycling_speed_and_cadence_service_csc_measurement_can_send_now(void static void cycling_speed_and_cadence_service_response_can_send_now(void * context){ cycling_speed_and_cadence_t * instance = (cycling_speed_and_cadence_t *) context; if (!instance){ - // printf("instance is null (cycling_speed_and_cadence_service_response_can_send_now)\n"); return; } @@ -216,16 +213,12 @@ static int cycling_speed_and_cadence_service_write_callback(hci_con_handle_t con UNUSED(buffer_size); cycling_speed_and_cadence_t * instance = &cycling_speed_and_cadence; - // printf("cycling_speed_and_cadence_service_write_callback: attr handle 0x%02x\n", attribute_handle); if (attribute_handle == instance->measurement_client_configuration_descriptor_handle){ if (buffer_size < 2u){ return ATT_ERROR_INVALID_OFFSET; } instance->measurement_client_configuration_descriptor_notify = little_endian_read_16(buffer, 0); instance->con_handle = con_handle; - // if (instance->measurement_client_configuration_descriptor_notify){ - // printf("enable notification\n"); - // } return 0; } @@ -235,9 +228,6 @@ static int cycling_speed_and_cadence_service_write_callback(hci_con_handle_t con } instance->control_point_client_configuration_descriptor_indicate = little_endian_read_16(buffer, 0); instance->con_handle = con_handle; - // if (instance->control_point_client_configuration_descriptor_indicate){ - // printf("enable indication\n"); - // } return 0; } @@ -276,7 +266,6 @@ static int cycling_speed_and_cadence_service_write_callback(hci_con_handle_t con instance->response_value = CSC_RESPONSE_VALUE_OP_CODE_NOT_SUPPORTED; break; } - // printf("control point, opcode %02x, response %02x\n", instance->request_opcode, instance->response_value); if (instance->control_point_client_configuration_descriptor_indicate){ instance->control_point_callback.callback = &cycling_speed_and_cadence_service_response_can_send_now; @@ -286,7 +275,6 @@ static int cycling_speed_and_cadence_service_write_callback(hci_con_handle_t con return 0; } - // printf("heart_rate_service_read_callback, not handeled read on handle 0x%02x\n", attribute_handle); return 0; } @@ -351,7 +339,6 @@ static void cycling_speed_and_cadence_service_calculate_cumulative_wheel_revolut instance->cumulative_wheel_revolutions = 0xffffffff; } } - // printf("cumulative 0x%04x, wheel revolution change %d\n", instance->cumulative_wheel_revolutions, revolutions_change); } static void cycling_speed_and_cadence_service_calculate_cumulative_crank_revolutions(uint16_t revolutions_change){ @@ -377,7 +364,6 @@ void cycling_speed_and_cadence_service_server_update_values(int32_t wheel_revolu if (instance->measurement_client_configuration_descriptor_notify){ instance->measurement_callback.callback = &cycling_speed_and_cadence_service_csc_measurement_can_send_now; instance->measurement_callback.context = (void*) instance; - // printf("cycling_speed_and_cadence_service_server_update_values instance %p, context %p\n", instance, instance->measurement_callback.context); att_server_register_can_send_now_callback(&instance->measurement_callback, instance->con_handle); } } diff --git a/src/btstack_hid_parser.c b/src/btstack_hid_parser.c index a96ff7a72..ed2c259ad 100644 --- a/src/btstack_hid_parser.c +++ b/src/btstack_hid_parser.c @@ -433,7 +433,6 @@ int btstack_hid_get_report_size_for_id(int report_id, hid_report_type_t report_t while (hid_descriptor_len){ int valid_report_type = 0; hid_descriptor_item_t item; - // printf("item: 0x%02x (%p)\n", *hid_descriptor, hid_descriptor); btstack_hid_parse_descriptor_item(&item, hid_descriptor, hid_descriptor_len); switch (item.item_type){ case Global: @@ -495,7 +494,6 @@ hid_report_id_status_t btstack_hid_id_valid(int report_id, uint16_t hid_descript switch ((GlobalItemTag)item.item_tag){ case ReportID: current_report_id = item.item_value; - // printf("current ID %d, searched ID %d\n", current_report_id, report_id); if (current_report_id != report_id) break; return HID_REPORT_ID_VALID; default: diff --git a/src/btstack_util.c b/src/btstack_util.c index 4945d1969..746230896 100644 --- a/src/btstack_util.c +++ b/src/btstack_util.c @@ -323,9 +323,6 @@ char * uuid128_to_str(const uint8_t * uuid){ static char bd_addr_to_str_buffer[6*3]; // 12:45:78:01:34:67\0 char * bd_addr_to_str(const bd_addr_t addr){ - // orig code - // sprintf(bd_addr_to_str_buffer, "%02x:%02x:%02x:%02x:%02x:%02x", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); - // sprintf-free code char * p = bd_addr_to_str_buffer; int i; for (i = 0; i < 6 ; i++) { diff --git a/src/classic/avrcp_controller.c b/src/classic/avrcp_controller.c index 1801131bc..92d933cf7 100644 --- a/src/classic/avrcp_controller.c +++ b/src/classic/avrcp_controller.c @@ -258,7 +258,6 @@ static void avrcp_controller_emit_now_playing_info_event_done(btstack_packet_han pos += 2; event[pos++] = ctype; event[pos++] = status; - // printf_hexdump(event, pos); (*callback)(HCI_EVENT_PACKET, 0, event, pos); } @@ -355,7 +354,6 @@ static void avrcp_parser_reset(avrcp_connection_t * connection){ static void avrcp_parser_process_byte(uint8_t byte, avrcp_connection_t * connection, avrcp_command_type_t ctype){ uint16_t attribute_total_value_len; uint32_t attribute_id; - // printf("avrcp_parser_process_byte: %02x, state %02x\n", byte, connection->parser_state); switch(connection->parser_state){ case AVRCP_PARSER_GET_ATTRIBUTE_HEADER: connection->parser_attribute_header[connection->parser_attribute_header_pos++] = byte; diff --git a/src/classic/btstack_sbc_decoder_bluedroid.c b/src/classic/btstack_sbc_decoder_bluedroid.c index 1d94fc1e8..1dfccb66f 100644 --- a/src/classic/btstack_sbc_decoder_bluedroid.c +++ b/src/classic/btstack_sbc_decoder_bluedroid.c @@ -46,10 +46,14 @@ #include "btstack_config.h" #include -#include + #include #include +#ifdef LOG_FRAME_STATUS +#include +#endif + #include "btstack_sbc.h" #include "btstack_sbc_plc.h" @@ -197,8 +201,6 @@ void btstack_sbc_decoder_init(btstack_sbc_decoder_state_t * state, btstack_sbc_m static void append_received_sbc_data(bludroid_decoder_state_t * state, uint8_t * buffer, int size){ int numFreeBytes = sizeof(state->frame_buffer) - state->bytes_in_frame_buffer; - // printf("append_received_sbc_data: bytes to append %u, sizeof %u, bytes in buffer %u, free %u\n", size,sizeof(state->frame_buffer), state->bytes_in_frame_buffer, numFreeBytes); - if (size > numFreeBytes){ log_error("SBC data: more bytes read %u than free bytes in buffer %u", size, numFreeBytes); } diff --git a/src/classic/btstack_sbc_encoder_bluedroid.c b/src/classic/btstack_sbc_encoder_bluedroid.c index 9ae883b43..ad400a83d 100644 --- a/src/classic/btstack_sbc_encoder_bluedroid.c +++ b/src/classic/btstack_sbc_encoder_bluedroid.c @@ -46,7 +46,6 @@ #include "btstack_config.h" #include -#include #include #include diff --git a/src/classic/btstack_sbc_plc.c b/src/classic/btstack_sbc_plc.c index 51891c33f..85b89ec7a 100644 --- a/src/classic/btstack_sbc_plc.c +++ b/src/classic/btstack_sbc_plc.c @@ -150,7 +150,6 @@ uint8_t * btstack_sbc_plc_zero_signal_frame(void){ void btstack_sbc_plc_init(btstack_sbc_plc_state_t *plc_state){ plc_state->nbf=0; plc_state->bestlag=0; - // printf("size\n"); memset(plc_state->hist,0,sizeof(plc_state->hist)); } diff --git a/src/classic/hfp_ag.c b/src/classic/hfp_ag.c index 8e7c5aafc..5ea3dd0d4 100644 --- a/src/classic/hfp_ag.c +++ b/src/classic/hfp_ag.c @@ -516,8 +516,6 @@ static int codecs_exchange_state_machine(hfp_connection_t * hfp_connection){ break; } - // printf(" -> State machine: CC\n"); - switch (hfp_connection->command){ case HFP_CMD_AVAILABLE_CODECS: if (hfp_connection->state < HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED){ @@ -1101,7 +1099,6 @@ static void hfp_ag_call_sm(hfp_ag_call_event_t event, hfp_connection_t * hfp_con int callheld_indicator_index = get_ag_indicator_index_for_name("callheld"); int call_indicator_index = get_ag_indicator_index_for_name("call"); - //printf("hfp_ag_call_sm event %d \n", event); switch (event){ case HFP_AG_INCOMING_CALL: switch (hfp_gsm_call_status()){ diff --git a/src/classic/hid_device.c b/src/classic/hid_device.c index 15eba3b53..1dbcfc474 100644 --- a/src/classic/hid_device.c +++ b/src/classic/hid_device.c @@ -417,7 +417,6 @@ static hid_handshake_param_type_t hid_device_set_report_cmd_is_valid(uint16_t ci default: break; } - // printf("hid_device_set_report_cmd_is_valid: report_id %d, status %d \n", report_id, report_id_status); } if (!hid_report_size_valid(cid, report_id, report_type, report_size-pos)){ @@ -450,7 +449,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack return; } message_type = (hid_message_type_t)(packet[0] >> 4); - // printf("L2CAP_DATA_PACKET message_type %d, packet_size %d \n", message_type, packet_size); switch (message_type){ case HID_MESSAGE_TYPE_GET_REPORT: @@ -527,7 +525,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack switch (device->protocol_mode){ case HID_PROTOCOL_MODE_BOOT: - // printf("HID_PROTOCOL_MODE_BOOT \n"); if (packet_size < 3){ device->report_status = HID_HANDSHAKE_PARAM_TYPE_ERR_INVALID_PARAMETER; break; @@ -538,7 +535,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack (*hci_device_set_report)(device->cid, device->report_type, packet_size-1, &packet[1]); break; case HID_PROTOCOL_MODE_REPORT: - // printf("HID_PROTOCOL_MODE_REPORT \n"); device->report_status = hid_device_set_report_cmd_is_valid(device->cid, device->report_type, packet_size - 1, &packet[1]); if (device->report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL) break; @@ -557,7 +553,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack l2cap_request_can_send_now_event(device->control_cid); break; case HID_MESSAGE_TYPE_GET_PROTOCOL: - // printf(" HID_MESSAGE_TYPE_GET_PROTOCOL\n"); device->state = HID_DEVICE_W2_GET_PROTOCOL; if (packet_size != 1) { device->report_status = HID_HANDSHAKE_PARAM_TYPE_ERR_INVALID_PARAMETER; @@ -565,7 +560,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack } device->report_status = HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL; // hid_device_request_can_send_now_event(channel); - // printf("HID_MESSAGE_TYPE_GET_PROTOCOL l2cap_request_can_send_now_event\n"); l2cap_request_can_send_now_event(device->control_cid); break; @@ -583,10 +577,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack device->protocol_mode = (hid_protocol_mode_t) param; switch (device->protocol_mode){ case HID_PROTOCOL_MODE_BOOT: - // printf("Set protocol mode to BOOT\n"); break; case HID_PROTOCOL_MODE_REPORT: - // printf("Set protocol mode to REPORT\n"); break; default: btstack_assert(false); @@ -714,7 +706,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack // connect HID Interrupt for outgoing if ((device->incoming == 0) && (psm == PSM_HID_CONTROL)){ - // printf("Create outgoing HID Interrupt\n"); status = l2cap_create_channel(packet_handler, device->bd_addr, PSM_HID_INTERRUPT, 48, &device->interrupt_cid); break; } @@ -753,7 +744,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack if (!device) return; switch (device->state){ case HID_DEVICE_W2_GET_REPORT:{ - // printf("HID_DEVICE_W2_GET_REPORT. on entry device->report_status %d \n", device->report_status); if (device->report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL) { report[0] = (HID_MESSAGE_TYPE_HANDSHAKE << 4) | device->report_status; hid_device_send_control_message(device->cid, &report[0], 1); @@ -765,11 +755,9 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack if (device->report_id){ report[pos++] = device->report_id; } - // printf(" report size with header and id %d\n", pos); report_size = 0; status = (*hci_device_get_report)(device->cid, device->report_type, device->report_id, &report_size, &report[pos]); - // printf(" report size %d, status after callback %d, expected report_size %d\n", report_size + pos, status, device->report_size + pos); switch (status){ case 0: @@ -802,7 +790,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack // break; // } - // printf("report type %d, report_size %d, report_size %d \n", device->report_type, report_size, device->report_size); hid_device_send_control_message(device->cid, &report[0], device->report_size); // device->state = HID_DEVICE_IDLE; break; @@ -814,13 +801,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack break; case HID_DEVICE_W2_GET_PROTOCOL: if (device->report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL){ - // printf("send HID_MESSAGE_TYPE_HANDSHAKE, report_status %d \n", device->report_status); report[0] = (HID_MESSAGE_TYPE_HANDSHAKE << 4) | device->report_status; hid_device_send_control_message(device->cid, &report[0], 1); break; } - // printf("send HID_MESSAGE_TYPE_DATA, protocol_mode %d \n", device->protocol_mode); report[0] = (HID_MESSAGE_TYPE_DATA << 4); report[1] = device->protocol_mode; hid_device_send_control_message(device->cid, &report[0], 2); diff --git a/src/classic/sdp_util.c b/src/classic/sdp_util.c index b04a7320d..83d0c5544 100644 --- a/src/classic/sdp_util.c +++ b/src/classic/sdp_util.c @@ -48,12 +48,15 @@ #include "classic/core.h" #include "classic/sdp_util.h" -#include #include #include #include #include // PRIx32 +#ifdef ENABLE_SDP_DES_DUMP +#include +#endif + #ifdef ENABLE_SDP_DES_DUMP // workaround for missing PRIx32 on mspgcc (16-bit MCU) #ifndef PRIx32 @@ -277,7 +280,6 @@ bool des_iterator_init(des_iterator_t * it, uint8_t * element){ it->element = element; it->pos = de_get_header_size(element); it->length = de_get_len(element); - // printf("des_iterator_init current pos %d, total len %d\n", it->pos, it->length); return true; } @@ -302,7 +304,6 @@ uint8_t * des_iterator_get_element(des_iterator_t * it){ void des_iterator_next(des_iterator_t * it){ int element_len = de_get_len(&it->element[it->pos]); - // printf("des_iterator_next element size %d, current pos %d, total len %d\n", element_len, it->pos, it->length); it->pos += element_len; }