mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-28 06:39:49 +00:00
use new bd_addr_to_str
This commit is contained in:
parent
a0a181d097
commit
339b676821
@ -190,9 +190,8 @@ static void ioregistry_get_info() {
|
|||||||
IOObjectRelease(bt_service);
|
IOObjectRelease(bt_service);
|
||||||
|
|
||||||
// dump info
|
// dump info
|
||||||
log_info("local-mac-address: ");
|
log_info("local-mac-address: %s\n", bd_addr_to_str(local_mac_address));
|
||||||
print_bd_addr(local_mac_address);
|
log_info("transport-speed: %u\n", transport_speed);
|
||||||
log_info("\ntransport-speed: %u\n", transport_speed);
|
|
||||||
#else
|
#else
|
||||||
// use dummy addr if not on iphone/ipod touch
|
// use dummy addr if not on iphone/ipod touch
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
14
src/hci.c
14
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){
|
static void hci_shutdown_connection(hci_connection_t *conn){
|
||||||
log_info("Connection closed: handle %u, ", conn->con_handle);
|
log_info("Connection closed: handle %u, %s\n", conn->con_handle, bd_addr_to_str(conn->address));
|
||||||
print_bd_addr( conn->address );
|
|
||||||
log_info("\n");
|
|
||||||
|
|
||||||
// cancel all l2cap connections
|
// cancel all l2cap connections
|
||||||
hci_emit_disconnection_complete(conn->con_handle, 0x16); // terminated by local host
|
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]);
|
bt_flip_addr(addr, &packet[2]);
|
||||||
// TODO: eval COD 8-10
|
// TODO: eval COD 8-10
|
||||||
link_type = packet[11];
|
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
|
if (link_type == 1) { // ACL
|
||||||
conn = connection_for_address(addr);
|
conn = connection_for_address(addr);
|
||||||
if (!conn) {
|
if (!conn) {
|
||||||
@ -467,7 +465,7 @@ static void event_handler(uint8_t *packet, int size){
|
|||||||
case HCI_EVENT_CONNECTION_COMPLETE:
|
case HCI_EVENT_CONNECTION_COMPLETE:
|
||||||
// Connection management
|
// Connection management
|
||||||
bt_flip_addr(addr, &packet[5]);
|
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);
|
conn = connection_for_address(addr);
|
||||||
if (conn) {
|
if (conn) {
|
||||||
if (!packet[2]){
|
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_set_timer(&conn->timeout, HCI_CONNECTION_TIMEOUT_MS);
|
||||||
run_loop_add_timer(&conn->timeout);
|
run_loop_add_timer(&conn->timeout);
|
||||||
|
|
||||||
log_info("New connection: handle %u, ", conn->con_handle);
|
log_info("New connection: handle %u, %s\n", conn->con_handle, bd_addr_to_str(conn->address));
|
||||||
print_bd_addr( conn->address );
|
|
||||||
log_info("\n");
|
|
||||||
|
|
||||||
hci_emit_nr_connections_changed();
|
hci_emit_nr_connections_changed();
|
||||||
} else {
|
} else {
|
||||||
@ -1086,7 +1082,7 @@ int hci_send_cmd_packet(uint8_t *packet, int size){
|
|||||||
// create_connection?
|
// create_connection?
|
||||||
if (IS_COMMAND(packet, hci_create_connection)){
|
if (IS_COMMAND(packet, hci_create_connection)){
|
||||||
bt_flip_addr(addr, &packet[3]);
|
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);
|
conn = connection_for_address(addr);
|
||||||
if (conn) {
|
if (conn) {
|
||||||
// if connection exists
|
// if connection exists
|
||||||
|
@ -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){
|
void rfcomm_create_channel_internal(void * connection, bd_addr_t *addr, uint8_t server_channel){
|
||||||
|
|
||||||
log_info("rfcomm_create_channel_internal to ");
|
log_info("rfcomm_create_channel_internal to %s, at channel #%02x\n", bd_addr_to_str(*addr), server_channel);
|
||||||
print_bd_addr(*addr);
|
|
||||||
log_info(" at channel #%02x\n", server_channel);
|
|
||||||
|
|
||||||
|
|
||||||
// create new multiplexer if necessary
|
// create new multiplexer if necessary
|
||||||
rfcomm_multiplexer_t * multiplexer = rfcomm_multiplexer_for_addr(addr);
|
rfcomm_multiplexer_t * multiplexer = rfcomm_multiplexer_for_addr(addr);
|
||||||
|
@ -98,7 +98,7 @@ char * bd_addr_to_str(bd_addr_t addr){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void print_bd_addr( 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
|
#ifndef EMBEDDED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user