From 339b676821daba02876936e8c13cf8dbfb9efd53 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Wed, 27 Jul 2011 22:03:34 +0000 Subject: [PATCH] use new bd_addr_to_str --- src/bt_control_iphone.m | 5 ++--- src/hci.c | 14 +++++--------- src/rfcomm.c | 5 +---- src/utils.c | 2 +- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/bt_control_iphone.m b/src/bt_control_iphone.m index 88bb3a6b3..32a27d16a 100644 --- a/src/bt_control_iphone.m +++ b/src/bt_control_iphone.m @@ -190,9 +190,8 @@ static void ioregistry_get_info() { IOObjectRelease(bt_service); // dump info - log_info("local-mac-address: "); - print_bd_addr(local_mac_address); - log_info("\ntransport-speed: %u\n", transport_speed); + log_info("local-mac-address: %s\n", bd_addr_to_str(local_mac_address)); + log_info("transport-speed: %u\n", transport_speed); #else // use dummy addr if not on iphone/ipod touch int i = 0; diff --git a/src/hci.c b/src/hci.c index 5480d7eda..33d67f1b5 100644 --- a/src/hci.c +++ b/src/hci.c @@ -337,9 +337,7 @@ static void acl_handler(uint8_t *packet, int size){ } static void hci_shutdown_connection(hci_connection_t *conn){ - log_info("Connection closed: handle %u, ", conn->con_handle); - print_bd_addr( conn->address ); - log_info("\n"); + log_info("Connection closed: handle %u, %s\n", conn->con_handle, bd_addr_to_str(conn->address)); // cancel all l2cap connections hci_emit_disconnection_complete(conn->con_handle, 0x16); // terminated by local host @@ -443,7 +441,7 @@ static void event_handler(uint8_t *packet, int size){ bt_flip_addr(addr, &packet[2]); // TODO: eval COD 8-10 link_type = packet[11]; - log_info("Connection_incoming: "); print_bd_addr(addr); log_info(", type %u\n", link_type); + log_info("Connection_incoming: %s, type %u\n", bd_addr_to_str(addr), link_type); if (link_type == 1) { // ACL conn = connection_for_address(addr); if (!conn) { @@ -467,7 +465,7 @@ static void event_handler(uint8_t *packet, int size){ case HCI_EVENT_CONNECTION_COMPLETE: // Connection management bt_flip_addr(addr, &packet[5]); - log_info("Connection_complete (status=%u)", packet[2]); print_bd_addr(addr); log_info("\n"); + log_info("Connection_complete (status=%u) %s\n", packet[2], bd_addr_to_str(addr)); conn = connection_for_address(addr); if (conn) { if (!packet[2]){ @@ -478,9 +476,7 @@ static void event_handler(uint8_t *packet, int size){ run_loop_set_timer(&conn->timeout, HCI_CONNECTION_TIMEOUT_MS); run_loop_add_timer(&conn->timeout); - log_info("New connection: handle %u, ", conn->con_handle); - print_bd_addr( conn->address ); - log_info("\n"); + log_info("New connection: handle %u, %s\n", conn->con_handle, bd_addr_to_str(conn->address)); hci_emit_nr_connections_changed(); } else { @@ -1086,7 +1082,7 @@ int hci_send_cmd_packet(uint8_t *packet, int size){ // create_connection? if (IS_COMMAND(packet, hci_create_connection)){ bt_flip_addr(addr, &packet[3]); - log_info("Create_connection to "); print_bd_addr(addr); log_info("\n"); + log_info("Create_connection to %s\n", bd_addr_to_str(addr)); conn = connection_for_address(addr); if (conn) { // if connection exists diff --git a/src/rfcomm.c b/src/rfcomm.c index bedec40c9..37dbb3880 100644 --- a/src/rfcomm.c +++ b/src/rfcomm.c @@ -1608,10 +1608,7 @@ int rfcomm_send_internal(uint8_t rfcomm_cid, uint8_t *data, uint16_t len){ void rfcomm_create_channel_internal(void * connection, bd_addr_t *addr, uint8_t server_channel){ - log_info("rfcomm_create_channel_internal to "); - print_bd_addr(*addr); - log_info(" at channel #%02x\n", server_channel); - + log_info("rfcomm_create_channel_internal to %s, at channel #%02x\n", bd_addr_to_str(*addr), server_channel); // create new multiplexer if necessary rfcomm_multiplexer_t * multiplexer = rfcomm_multiplexer_for_addr(addr); diff --git a/src/utils.c b/src/utils.c index 74ac7d310..3e185a2b7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -98,7 +98,7 @@ char * bd_addr_to_str(bd_addr_t addr){ } void print_bd_addr( bd_addr_t addr){ - log_info("%s", bd_addr_to_str(&addr)); + log_info("%s", bd_addr_to_str(addr)); } #ifndef EMBEDDED