diff --git a/system/stack/pan/pan_api.cc b/system/stack/pan/pan_api.cc index 52db9adb02f95e7b6a4b11ac81394152762541db..0e6aaaad6cea2d0ef1b88c657fad0d3cac971b03 100644 --- a/system/stack/pan/pan_api.cc +++ b/system/stack/pan/pan_api.cc @@ -29,6 +29,7 @@ #include <base/logging.h> #include <base/strings/stringprintf.h> +#include <bluetooth/log.h> #include <cstdint> #include <cstring> @@ -47,6 +48,7 @@ #include "types/bluetooth/uuid.h" #include "types/raw_address.h" +using namespace bluetooth; using namespace bluetooth::legacy::stack::sdp; using bluetooth::Uuid; @@ -153,18 +155,18 @@ tPAN_RESULT PAN_SetRole(uint8_t role, std::string p_user_name, /* If the role is not a valid combination reject it */ if ((!(role & (PAN_ROLE_CLIENT | PAN_ROLE_NAP_SERVER))) && role != PAN_ROLE_INACTIVE) { - LOG_ERROR("PAN role %d is invalid", role); + log::error("PAN role {} is invalid", role); return PAN_FAILURE; } /* If the current active role is same as the role being set do nothing */ if (pan_cb.role == role) { - LOG_VERBOSE("PAN role already was set to: %d", role); + log::verbose("PAN role already was set to: {}", role); return PAN_SUCCESS; } /* Register all the roles with SDP */ - LOG_VERBOSE("PAN_SetRole() called with role 0x%x", role); + log::verbose("PAN_SetRole() called with role 0x{:x}", role); if (role & PAN_ROLE_NAP_SERVER) { /* Check the service name */ if (p_nap_name.empty()) @@ -222,7 +224,7 @@ tPAN_RESULT PAN_SetRole(uint8_t role, std::string p_user_name, } pan_cb.role = role; - LOG_VERBOSE("PAN role set to: %d", role); + log::verbose("PAN role set to: {}", role); BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Role change", base::StringPrintf("role:0x%x", role)); @@ -264,15 +266,15 @@ tPAN_RESULT PAN_Connect(const RawAddress& rem_bda, tPAN_ROLE src_role, /* Check if PAN is active or not */ if (!(pan_cb.role & src_role)) { - LOG_ERROR("PAN is not active for the role %d", src_role); + log::error("PAN is not active for the role {}", src_role); return PAN_FAILURE; } /* Validate the parameters before proceeding */ if ((src_role != PAN_ROLE_CLIENT && src_role != PAN_ROLE_NAP_SERVER) || (dst_role != PAN_ROLE_CLIENT && dst_role != PAN_ROLE_NAP_SERVER)) { - LOG_ERROR("Either source %d or destination role %d is invalid", src_role, - dst_role); + log::error("Either source {} or destination role {} is invalid", src_role, + dst_role); return PAN_FAILURE; } @@ -288,7 +290,7 @@ tPAN_RESULT PAN_Connect(const RawAddress& rem_bda, tPAN_ROLE src_role, ** because if there is already a connection we cannot accept ** another connection in PANU role */ - LOG_ERROR( + log::error( "Cannot make PANU connections when there are more than one " "connection"); return PAN_INVALID_SRC_ROLE; @@ -305,7 +307,7 @@ tPAN_RESULT PAN_Connect(const RawAddress& rem_bda, tPAN_ROLE src_role, /* If destination is PANU role validate source role */ else if (dst_role == PAN_ROLE_CLIENT) { if (pan_cb.num_conns && pan_cb.active_role == PAN_ROLE_CLIENT && !pcb) { - LOG_ERROR("Device already have a connection in PANU role"); + log::error("Device already have a connection in PANU role"); return PAN_INVALID_SRC_ROLE; } @@ -315,19 +317,19 @@ tPAN_RESULT PAN_Connect(const RawAddress& rem_bda, tPAN_ROLE src_role, } /* The role combination is not valid */ else { - LOG_ERROR("Source %d and Destination roles %d are not valid combination", - src_role, dst_role); + log::error("Source {} and Destination roles {} are not valid combination", + src_role, dst_role); return PAN_FAILURE; } /* Allocate control block and initiate connection */ if (!pcb) pcb = pan_allocate_pcb(rem_bda, BNEP_INVALID_HANDLE); if (!pcb) { - LOG_ERROR("PAN Connection failed because of no resources"); + log::error("PAN Connection failed because of no resources"); return PAN_NO_RESOURCES; } - VLOG(0) << __func__ << " for BD Addr: " << rem_bda; + log::verbose("for BD Addr: {}", ADDRESS_TO_LOGGABLE_STR(rem_bda)); if (pcb->con_state == PAN_STATE_IDLE) { pan_cb.num_conns++; } else if (pcb->con_state == PAN_STATE_CONNECTED) { @@ -351,7 +353,7 @@ tPAN_RESULT PAN_Connect(const RawAddress& rem_bda, tPAN_ROLE src_role, return (tPAN_RESULT)ret; } - LOG_VERBOSE("PAN_Connect() current active role set to %d", src_role); + log::verbose("PAN_Connect() current active role set to {}", src_role); pan_cb.prv_active_role = pan_cb.active_role; pan_cb.active_role = src_role; *handle = pcb->handle; @@ -379,7 +381,7 @@ tPAN_RESULT PAN_Disconnect(uint16_t handle) { /* Check if the connection exists */ pcb = pan_get_pcb_by_handle(handle); if (!pcb) { - LOG_ERROR("PAN connection not found for the handle %d", handle); + log::error("PAN connection not found for the handle {}", handle); return PAN_FAILURE; } @@ -394,11 +396,11 @@ tPAN_RESULT PAN_Disconnect(uint16_t handle) { pan_release_pcb(pcb); if (result != BNEP_SUCCESS) { - LOG_VERBOSE("Error in closing PAN connection"); + log::verbose("Error in closing PAN connection"); return PAN_FAILURE; } - LOG_VERBOSE("PAN connection closed"); + log::verbose("PAN connection closed"); return PAN_SUCCESS; } @@ -429,7 +431,7 @@ tPAN_RESULT PAN_Write(uint16_t handle, const RawAddress& dst, const RawAddress& src, uint16_t protocol, uint8_t* p_data, uint16_t len, bool ext) { if (pan_cb.role == PAN_ROLE_INACTIVE || !pan_cb.num_conns) { - LOG_ERROR("%s PAN is not active, data write failed.", __func__); + log::error("PAN is not active, data write failed."); return PAN_FAILURE; } @@ -486,7 +488,7 @@ tPAN_RESULT PAN_WriteBuf(uint16_t handle, const RawAddress& dst, tBNEP_RESULT result; if (pan_cb.role == PAN_ROLE_INACTIVE || (!(pan_cb.num_conns))) { - LOG_ERROR("PAN is not active Data write failed"); + log::error("PAN is not active Data write failed"); osi_free(p_buf); return PAN_FAILURE; } @@ -513,7 +515,7 @@ tPAN_RESULT PAN_WriteBuf(uint16_t handle, const RawAddress& dst, } if (i == MAX_PAN_CONNS) { - LOG_ERROR("PAN Don't have any user connections"); + log::error("PAN Don't have any user connections"); osi_free(p_buf); return PAN_FAILURE; } @@ -521,30 +523,30 @@ tPAN_RESULT PAN_WriteBuf(uint16_t handle, const RawAddress& dst, result = BNEP_WriteBuf(pan_cb.pcb[i].handle, dst, p_buf, protocol, src, ext); if (result == BNEP_IGNORE_CMD) { - LOG_VERBOSE("PAN ignored data write for PANU connection"); + log::verbose("PAN ignored data write for PANU connection"); return (tPAN_RESULT)result; } else if (result != BNEP_SUCCESS) { - LOG_ERROR("PAN failed to write data for the PANU connection"); + log::error("PAN failed to write data for the PANU connection"); return (tPAN_RESULT)result; } pan_cb.pcb[i].write.octets += p_buf->len; pan_cb.pcb[i].write.packets++; - LOG_VERBOSE("PAN successfully wrote data for the PANU connection"); + log::verbose("PAN successfully wrote data for the PANU connection"); return PAN_SUCCESS; } /* findout to which connection the data is meant for */ pcb = pan_get_pcb_by_handle(handle); if (!pcb) { - LOG_ERROR("PAN Buf write for wrong handle"); + log::error("PAN Buf write for wrong handle"); osi_free(p_buf); return PAN_FAILURE; } if (pcb->con_state != PAN_STATE_CONNECTED) { - LOG_ERROR("PAN Buf write when conn is not active"); + log::error("PAN Buf write when conn is not active"); pcb->write.drops++; osi_free(p_buf); return PAN_FAILURE; @@ -553,11 +555,11 @@ tPAN_RESULT PAN_WriteBuf(uint16_t handle, const RawAddress& dst, uint16_t len = p_buf->len; result = BNEP_WriteBuf(pcb->handle, dst, p_buf, protocol, src, ext); if (result == BNEP_IGNORE_CMD) { - LOG_VERBOSE("PAN ignored data buf write to PANU"); + log::verbose("PAN ignored data buf write to PANU"); pcb->write.errors++; return PAN_IGNORE_CMD; } else if (result != BNEP_SUCCESS) { - LOG_ERROR("PAN failed to send data buf to the PANU"); + log::error("PAN failed to send data buf to the PANU"); pcb->write.errors++; return (tPAN_RESULT)result; } @@ -565,7 +567,7 @@ tPAN_RESULT PAN_WriteBuf(uint16_t handle, const RawAddress& dst, pcb->write.octets += len; pcb->write.packets++; - LOG_VERBOSE("PAN successfully sent data buf to the PANU"); + log::verbose("PAN successfully sent data buf to the PANU"); return PAN_SUCCESS; } @@ -594,18 +596,18 @@ tPAN_RESULT PAN_SetProtocolFilters(uint16_t handle, uint16_t num_filters, /* Check if the connection exists */ pcb = pan_get_pcb_by_handle(handle); if (!pcb) { - LOG_ERROR("PAN connection not found for the handle %d", handle); + log::error("PAN connection not found for the handle {}", handle); return PAN_FAILURE; } tBNEP_RESULT result = BNEP_SetProtocolFilters(pcb->handle, num_filters, p_start_array, p_end_array); if (result != BNEP_SUCCESS) { - LOG_ERROR("PAN failed to set protocol filters for handle %d", handle); + log::error("PAN failed to set protocol filters for handle {}", handle); return (tPAN_RESULT)result; } - LOG_VERBOSE("PAN successfully sent protocol filters for handle %d", handle); + log::verbose("PAN successfully sent protocol filters for handle {}", handle); return PAN_SUCCESS; } @@ -633,18 +635,18 @@ tPAN_RESULT PAN_SetMulticastFilters(uint16_t handle, uint16_t num_mcast_filters, /* Check if the connection exists */ pcb = pan_get_pcb_by_handle(handle); if (!pcb) { - LOG_ERROR("PAN connection not found for the handle %d", handle); + log::error("PAN connection not found for the handle {}", handle); return PAN_FAILURE; } tBNEP_RESULT result = BNEP_SetMulticastFilters(pcb->handle, num_mcast_filters, p_start_array, p_end_array); if (result != BNEP_SUCCESS) { - LOG_ERROR("PAN failed to set multicast filters for handle %d", handle); + log::error("PAN failed to set multicast filters for handle {}", handle); return (tPAN_RESULT)result; } - LOG_VERBOSE("PAN successfully sent multicast filters for handle %d", handle); + log::verbose("PAN successfully sent multicast filters for handle {}", handle); return PAN_SUCCESS; } diff --git a/system/stack/pan/pan_int.h b/system/stack/pan/pan_int.h index bf0060d1bdde35c7481dabe11de2206bf401ee22..b73eae77c6395eab9a8e14160596699a8ff83428 100644 --- a/system/stack/pan/pan_int.h +++ b/system/stack/pan/pan_int.h @@ -25,6 +25,8 @@ #ifndef PAN_INT_H #define PAN_INT_H +#include <bluetooth/log.h> + #include <cstdint> #include "internal_include/bt_target.h" @@ -134,4 +136,9 @@ void pan_dump_status(void); /******************************************************************************/ +namespace fmt { +template <> +struct formatter<tPAN_STATE> : enum_formatter<tPAN_STATE> {}; +} // namespace fmt + #endif diff --git a/system/stack/pan/pan_main.cc b/system/stack/pan/pan_main.cc index 284ac54b25d0567b30b8c2e1d2a0c8a012970608..28d1291ac3574f00116e757e8beb24c1c0f74a03 100644 --- a/system/stack/pan/pan_main.cc +++ b/system/stack/pan/pan_main.cc @@ -26,6 +26,7 @@ #define LOG_TAG "pan" #include <base/strings/stringprintf.h> +#include <bluetooth/log.h> #include <string.h> // memset #include <cstdint> @@ -40,6 +41,7 @@ #include "types/bluetooth/uuid.h" #include "types/raw_address.h" +using namespace bluetooth; using bluetooth::Uuid; tPAN_CB pan_cb; @@ -101,13 +103,13 @@ void pan_conn_ind_cb(uint16_t handle, const RawAddress& p_bda, */ if (!remote_uuid.Is16Bit()) { - LOG_ERROR("PAN Connection failed because of wrong remote UUID "); + log::error("PAN Connection failed because of wrong remote UUID"); BNEP_ConnectResp(handle, BNEP_CONN_FAILED_SRC_UUID); return; } if (!local_uuid.Is16Bit()) { - LOG_ERROR("PAN Connection failed because of wrong local UUID "); + log::error("PAN Connection failed because of wrong local UUID"); BNEP_ConnectResp(handle, BNEP_CONN_FAILED_DST_UUID); return; } @@ -115,17 +117,17 @@ void pan_conn_ind_cb(uint16_t handle, const RawAddress& p_bda, uint16_t remote_uuid16 = remote_uuid.As16Bit(); uint16_t local_uuid16 = local_uuid.As16Bit(); - LOG_VERBOSE( - "%s - handle %d, current role %d, dst uuid 0x%x, src uuid 0x%x, role " - "change %s", - __func__, handle, pan_cb.role, local_uuid16, remote_uuid16, + log::verbose( + "handle {}, current role {}, dst uuid 0x{:x}, src uuid 0x{:x}, role " + "change {}", + handle, pan_cb.role, local_uuid16, remote_uuid16, is_role_change ? "YES" : "NO"); /* Check if the source UUID is a valid one */ if (remote_uuid16 != UUID_SERVCLASS_PANU && remote_uuid16 != UUID_SERVCLASS_NAP && remote_uuid16 != UUID_SERVCLASS_GN) { - LOG_ERROR("Src UUID 0x%x is not valid", remote_uuid16); + log::error("Src UUID 0x{:x} is not valid", remote_uuid16); BNEP_ConnectResp(handle, BNEP_CONN_FAILED_SRC_UUID); return; } @@ -133,7 +135,7 @@ void pan_conn_ind_cb(uint16_t handle, const RawAddress& p_bda, /* Check if the destination UUID is a valid one */ if (local_uuid16 != UUID_SERVCLASS_PANU && local_uuid16 != UUID_SERVCLASS_NAP && local_uuid16 != UUID_SERVCLASS_GN) { - LOG_ERROR("Dst UUID 0x%x is not valid", local_uuid16); + log::error("Dst UUID 0x{:x} is not valid", local_uuid16); BNEP_ConnectResp(handle, BNEP_CONN_FAILED_DST_UUID); return; } @@ -145,8 +147,8 @@ void pan_conn_ind_cb(uint16_t handle, const RawAddress& p_bda, local_uuid16 == UUID_SERVCLASS_GN) || ((!(pan_cb.role & UUID_SERVCLASS_NAP)) && local_uuid16 == UUID_SERVCLASS_NAP)) { - LOG_ERROR( - "PAN Connection failed because of unsupported destination UUID 0x%x", + log::error( + "PAN Connection failed because of unsupported destination UUID 0x{:x}", local_uuid16); BNEP_ConnectResp(handle, BNEP_CONN_FAILED_DST_UUID); return; @@ -176,9 +178,9 @@ void pan_conn_ind_cb(uint16_t handle, const RawAddress& p_bda, is_valid_interaction = false; } if (!is_valid_interaction) { - LOG_ERROR( + log::error( "PAN Connection failed because of invalid PAN profile roles " - "interaction: Remote UUID 0x%x Local UUID 0x%x", + "interaction: Remote UUID 0x{:x} Local UUID 0x{:x}", remote_uuid16, local_uuid16); BNEP_ConnectResp(handle, BNEP_CONN_FAILED_SRC_UUID); return; @@ -200,7 +202,7 @@ void pan_conn_ind_cb(uint16_t handle, const RawAddress& p_bda, /* There are connections other than this one ** so we cann't accept PANU role. Reject */ - LOG_ERROR( + log::error( "Dst UUID should be either GN or NAP only because there are other " "connections"); BNEP_ConnectResp(handle, BNEP_CONN_FAILED_DST_UUID); @@ -209,8 +211,8 @@ void pan_conn_ind_cb(uint16_t handle, const RawAddress& p_bda, /* If it is already in connected state check for bridging status */ if (pcb->con_state == PAN_STATE_CONNECTED) { - LOG_VERBOSE("PAN Role changing New Src 0x%x Dst 0x%x", remote_uuid16, - local_uuid16); + log::verbose("PAN Role changing New Src 0x{:x} Dst 0x{:x}", remote_uuid16, + local_uuid16); pcb->prv_src_uuid = pcb->src_uuid; pcb->prv_dst_uuid = pcb->dst_uuid; @@ -235,22 +237,22 @@ void pan_conn_ind_cb(uint16_t handle, const RawAddress& p_bda, */ if (pan_cb.num_conns && (local_uuid16 == UUID_SERVCLASS_PANU || pan_cb.active_role == PAN_ROLE_CLIENT)) { - LOG_ERROR("PAN already have a connection and can't be user"); + log::error("PAN already have a connection and can't be user"); BNEP_ConnectResp(handle, BNEP_CONN_FAILED_DST_UUID); return; } } /* This is a new connection */ - LOG_VERBOSE("New connection indication for handle %d", handle); + log::verbose("New connection indication for handle {}", handle); pcb = pan_allocate_pcb(p_bda, handle); if (!pcb) { - LOG_ERROR("PAN no control block for new connection"); + log::error("PAN no control block for new connection"); BNEP_ConnectResp(handle, BNEP_CONN_FAILED); return; } - LOG_VERBOSE("PAN connection destination UUID is 0x%x", local_uuid16); + log::verbose("PAN connection destination UUID is 0x{:x}", local_uuid16); /* Set the latest active PAN role */ pan_cb.active_role = req_role; pcb->src_uuid = local_uuid16; @@ -287,11 +289,11 @@ void pan_connect_state_cb(uint16_t handle, tPAN_CONN* pcb; uint8_t peer_role; - LOG_VERBOSE("pan_connect_state_cb - for handle %d, result %d", handle, - result); + log::verbose("pan_connect_state_cb - for handle {}, result {}", handle, + result); pcb = pan_get_pcb_by_handle(handle); if (!pcb) { - LOG_ERROR("PAN State change indication for wrong handle %d", handle); + log::error("PAN State change indication for wrong handle {}", handle); return; } @@ -307,7 +309,7 @@ void pan_connect_state_cb(uint16_t handle, if (pcb->con_state != PAN_STATE_CONNECTED && (pcb->con_flags & PAN_FLAGS_CONN_COMPLETED)) { /* restore the original values */ - LOG_VERBOSE("restoring the connection state to active"); + log::verbose("restoring the connection state to active"); pcb->con_state = PAN_STATE_CONNECTED; pcb->con_flags &= (~PAN_FLAGS_CONN_COMPLETED); @@ -352,7 +354,7 @@ void pan_connect_state_cb(uint16_t handle, /* Create bridge if the destination role is NAP */ if (pan_cb.pan_bridge_req_cb && pcb->src_uuid == UUID_SERVCLASS_NAP) { - LOG_VERBOSE("PAN requesting for bridge"); + log::verbose("PAN requesting for bridge"); (*pan_cb.pan_bridge_req_cb)(pcb->rem_bda, true); } } @@ -389,14 +391,14 @@ void pan_data_buf_ind_cb(uint16_t handle, const RawAddress& src, /* Check if the connection is in right state */ pcb = pan_get_pcb_by_handle(handle); if (!pcb) { - LOG_ERROR("PAN Data buffer indication for wrong handle %d", handle); + log::error("PAN Data buffer indication for wrong handle {}", handle); osi_free(p_buf); return; } if (pcb->con_state != PAN_STATE_CONNECTED) { - LOG_ERROR("PAN Data indication in wrong state %d for handle %d", - pcb->con_state, handle); + log::error("PAN Data indication in wrong state {} for handle {}", + pcb->con_state, handle); pcb->read.drops++; osi_free(p_buf); return; @@ -408,8 +410,8 @@ void pan_data_buf_ind_cb(uint16_t handle, const RawAddress& src, pcb->read.octets += len; pcb->read.packets++; - LOG_VERBOSE( - "pan_data_buf_ind_cb - for handle %d, protocol 0x%x, length %d, ext %d", + log::verbose( + "pan_data_buf_ind_cb - for handle {}, protocol 0x{:x}, length {}, ext {}", handle, protocol, len, ext); if (pcb->src_uuid == UUID_SERVCLASS_NAP) @@ -420,8 +422,9 @@ void pan_data_buf_ind_cb(uint16_t handle, const RawAddress& src, /* Check if it is broadcast or multicast packet */ if (pcb->src_uuid != UUID_SERVCLASS_PANU) { if (dst.address[0] & 0x01) { - LOG_VERBOSE("PAN received broadcast packet on handle %d, src uuid 0x%x", - handle, pcb->src_uuid); + log::verbose( + "PAN received broadcast packet on handle {}, src uuid 0x{:x}", handle, + pcb->src_uuid); for (i = 0; i < MAX_PAN_CONNS; i++) { if (pan_cb.pcb[i].con_state == PAN_STATE_CONNECTED && pan_cb.pcb[i].handle != handle && @@ -445,15 +448,15 @@ void pan_data_buf_ind_cb(uint16_t handle, const RawAddress& src, /* Check if it is for any other PAN connection */ dst_pcb = pan_get_pcb_by_addr(dst); if (dst_pcb) { - LOG_VERBOSE( - "%s - destination PANU found on handle %d and sending data, len: %d", - __func__, dst_pcb->handle, len); + log::verbose( + "destination PANU found on handle {} and sending data, len: {}", + dst_pcb->handle, len); result = BNEP_Write(dst_pcb->handle, dst, p_data, len, protocol, src, ext); if (result != BNEP_SUCCESS && result != BNEP_IGNORE_CMD) - LOG_ERROR("Failed to write data for PAN connection handle %d", - dst_pcb->handle); + log::error("Failed to write data for PAN connection handle {}", + dst_pcb->handle); pcb->read.errors++; osi_free(p_buf); return; @@ -515,9 +518,9 @@ void pan_tx_data_flow_cb(uint16_t handle, tBNEP_RESULT result) { void pan_proto_filt_ind_cb(uint16_t handle, bool indication, tBNEP_RESULT result, uint16_t num_filters, uint8_t* p_filters) { - LOG_VERBOSE( - "pan_proto_filt_ind_cb - called for handle %d with ind %d, result %d, " - "num %d", + log::verbose( + "pan_proto_filt_ind_cb - called for handle {} with ind {}, result {}, " + "num {}", handle, indication, result, num_filters); if (pan_cb.pan_pfilt_ind_cb) @@ -549,9 +552,9 @@ void pan_proto_filt_ind_cb(uint16_t handle, bool indication, void pan_mcast_filt_ind_cb(uint16_t handle, bool indication, tBNEP_RESULT result, uint16_t num_filters, uint8_t* p_filters) { - LOG_VERBOSE( - "pan_mcast_filt_ind_cb - called for handle %d with ind %d, result %d, " - "num %d", + log::verbose( + "pan_mcast_filt_ind_cb - called for handle {} with ind {}, result {}, " + "num {}", handle, indication, result, num_filters); if (pan_cb.pan_mfilt_ind_cb) diff --git a/system/stack/pan/pan_utils.cc b/system/stack/pan/pan_utils.cc index e33f1e38d9914fe7fb6786d898cd4cef73d9ef29..6156d1659eb0d32f4273f080990b144293b74714 100644 --- a/system/stack/pan/pan_utils.cc +++ b/system/stack/pan/pan_utils.cc @@ -26,6 +26,7 @@ #define LOG_TAG "pan" #include <base/logging.h> +#include <bluetooth/log.h> #include <cstdint> @@ -38,6 +39,7 @@ #include "stack/pan/pan_int.h" #include "types/raw_address.h" +using namespace bluetooth; using namespace bluetooth::legacy::stack::sdp; static const uint8_t pan_proto_elem_data[] = { @@ -76,7 +78,7 @@ uint32_t pan_register_with_sdp(uint16_t uuid, const char* p_name, sdp_handle = get_legacy_stack_sdp_api()->handle.SDP_CreateRecord(); if (sdp_handle == 0) { - LOG_ERROR("PAN_SetRole - could not create SDP record"); + log::error("PAN_SetRole - could not create SDP record"); return 0; } @@ -279,13 +281,13 @@ void pan_dump_status(void) { uint16_t i; tPAN_CONN* p_pcb; - LOG_VERBOSE("PAN role %x, active role %d, num_conns %d", pan_cb.role, - pan_cb.active_role, pan_cb.num_conns); + log::verbose("PAN role {:x}, active role {}, num_conns {}", pan_cb.role, + pan_cb.active_role, pan_cb.num_conns); for (i = 0, p_pcb = pan_cb.pcb; i < MAX_PAN_CONNS; i++, p_pcb++) { - VLOG(1) << +i << " state:" << p_pcb->con_state - << ", handle:" << p_pcb->handle << ", src" << p_pcb->src_uuid - << ", BD:" << p_pcb->rem_bda; + log::verbose("{} state:{}, handle:{}, src{}, BD:{}", i, p_pcb->con_state, + p_pcb->handle, p_pcb->src_uuid, + ADDRESS_TO_LOGGABLE_STR(p_pcb->rem_bda)); } #endif }