* SOFTWARE.
*/
-#define BT_LOG_TAG "PORT"
-#include "lib/lib-logging.h"
+#define BT_LOG_TAG "LIB/PORT"
+#include "lib/logging.h"
#include "common/assert.h"
#include "lib/assert-pre.h"
BT_ASSERT(strlen(name) > 0);
port = g_new0(struct bt_port, 1);
if (!port) {
- BT_LOGE_STR("Failed to allocate one port.");
+ BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one port.");
goto end;
}
bt_object_init_shared_with_parent(&port->base, destroy_port);
port->name = g_string_new(name);
if (!port->name) {
- BT_LOGE_STR("Failed to allocate one GString.");
+ BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one GString.");
BT_OBJECT_PUT_REF_AND_RESET(port);
goto end;
}
const char *bt_port_get_name(const struct bt_port *port)
{
- BT_ASSERT_PRE_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
return port->name->str;
}
enum bt_port_type bt_port_get_type(const struct bt_port *port)
{
- BT_ASSERT_PRE_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
return port->type;
}
const struct bt_connection *bt_port_borrow_connection_const(
const struct bt_port *port)
{
- BT_ASSERT_PRE_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
return port->connection;
}
const struct bt_component *bt_port_borrow_component_const(
const struct bt_port *port)
{
- BT_ASSERT_PRE_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
return bt_port_borrow_component_inline(port);
}
struct bt_self_component *bt_self_component_port_borrow_component(
struct bt_self_component_port *port)
{
- BT_ASSERT_PRE_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
return (void *) bt_object_borrow_parent((void *) port);
}
bt_bool bt_port_is_connected(const struct bt_port *port)
{
- BT_ASSERT_PRE_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
return port->connection ? BT_TRUE : BT_FALSE;
}
void *bt_self_component_port_get_data(const struct bt_self_component_port *port)
{
- BT_ASSERT_PRE_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
return ((struct bt_port *) port)->user_data;
}