diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 19e93a8a610..73fb42cee0f 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -1430,7 +1430,7 @@ static void gatt_unregister_ccc(struct _bt_gatt_ccc *ccc) for (size_t i = 0; i < ARRAY_SIZE(ccc->cfg); i++) { struct bt_gatt_ccc_cfg *cfg = &ccc->cfg[i]; - if (bt_addr_le_cmp(&cfg->peer, BT_ADDR_LE_ANY)) { + if (!bt_addr_le_eq(&cfg->peer, BT_ADDR_LE_ANY)) { struct bt_conn *conn; bool store = true; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index b43721229a4..e746c4182a2 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -580,7 +580,7 @@ int bt_le_create_conn_ext(const struct bt_conn *conn) } else { const bt_addr_le_t *peer_addr = &conn->le.dst; - if (bt_addr_le_cmp(&conn->le.resp_addr, BT_ADDR_LE_ANY)) { + if (!bt_addr_le_eq(&conn->le.resp_addr, BT_ADDR_LE_ANY)) { /* Host resolving is used, use the RPA directly. */ peer_addr = &conn->le.resp_addr; BT_DBG("Using resp_addr %s", bt_addr_le_str(peer_addr)); @@ -653,7 +653,7 @@ static int bt_le_create_conn_legacy(const struct bt_conn *conn) } else { const bt_addr_le_t *peer_addr = &conn->le.dst; - if (bt_addr_le_cmp(&conn->le.resp_addr, BT_ADDR_LE_ANY)) { + if (!bt_addr_le_eq(&conn->le.resp_addr, BT_ADDR_LE_ANY)) { /* Host resolving is used, use the RPA directly. */ peer_addr = &conn->le.resp_addr; BT_DBG("Using resp_addr %s", bt_addr_le_str(peer_addr)); diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 187126852c7..ca9e44ddf3c 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -1065,7 +1065,7 @@ static int id_find(const bt_addr_le_t *addr) static int id_create(uint8_t id, bt_addr_le_t *addr, uint8_t *irk) { - if (addr && bt_addr_le_cmp(addr, BT_ADDR_LE_ANY)) { + if (addr && !bt_addr_le_eq(addr, BT_ADDR_LE_ANY)) { bt_addr_le_copy(&bt_dev.id_addr[id], addr); } else { bt_addr_le_t new_addr; @@ -1123,7 +1123,7 @@ int bt_id_create(bt_addr_le_t *addr, uint8_t *irk) { int new_id, err; - if (addr && bt_addr_le_cmp(addr, BT_ADDR_LE_ANY)) { + if (addr && !bt_addr_le_eq(addr, BT_ADDR_LE_ANY)) { if (addr->type != BT_ADDR_LE_RANDOM || !BT_ADDR_IS_STATIC(&addr->a)) { BT_ERR("Only static random identity address supported"); @@ -1147,7 +1147,7 @@ int bt_id_create(bt_addr_le_t *addr, uint8_t *irk) if (!atomic_test_bit(bt_dev.flags, BT_DEV_ENABLE)) { uint8_t zero_irk[16] = { 0 }; - if (!(addr && bt_addr_le_cmp(addr, BT_ADDR_LE_ANY))) { + if (!(addr && !bt_addr_le_eq(addr, BT_ADDR_LE_ANY))) { return -EINVAL; } @@ -1170,7 +1170,7 @@ int bt_id_reset(uint8_t id, bt_addr_le_t *addr, uint8_t *irk) { int err; - if (addr && bt_addr_le_cmp(addr, BT_ADDR_LE_ANY)) { + if (addr && !bt_addr_le_eq(addr, BT_ADDR_LE_ANY)) { if (addr->type != BT_ADDR_LE_RANDOM || !BT_ADDR_IS_STATIC(&addr->a)) { BT_ERR("Only static random identity address supported"); @@ -1203,7 +1203,7 @@ int bt_id_reset(uint8_t id, bt_addr_le_t *addr, uint8_t *irk) } if (IS_ENABLED(CONFIG_BT_CONN) && - bt_addr_le_cmp(&bt_dev.id_addr[id], BT_ADDR_LE_ANY)) { + !bt_addr_le_eq(&bt_dev.id_addr[id], BT_ADDR_LE_ANY)) { err = bt_unpair(id, NULL); if (err) { return err; diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index 23543b1a7ab..d411daba9b3 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -892,7 +892,7 @@ void bt_hci_le_per_adv_sync_established(struct net_buf *buf) (!atomic_test_bit(pending_per_adv_sync->flags, BT_PER_ADV_SYNC_SYNCING_USE_LIST) && ((pending_per_adv_sync->sid != evt->sid) || - bt_addr_le_cmp(&pending_per_adv_sync->addr, &evt->adv_addr)))) { + !bt_addr_le_eq(&pending_per_adv_sync->addr, &evt->adv_addr)))) { BT_ERR("Unexpected per adv sync established event"); /* Request terminate of pending periodic advertising in controller */ per_adv_sync_terminate(sys_le16_to_cpu(evt->handle)); diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 8bc3f67301a..8be63f64a93 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -1522,7 +1522,7 @@ static uint8_t smp_br_ident_addr_info(struct bt_smp_br *smp, bt_addr_copy(&addr.a, &conn->br.dst); addr.type = BT_ADDR_LE_PUBLIC; - if (bt_addr_le_cmp(&addr, &req->addr)) { + if (!bt_addr_le_eq(&addr, &req->addr)) { return BT_SMP_ERR_UNSPECIFIED; } diff --git a/subsys/bluetooth/shell/bt.c b/subsys/bluetooth/shell/bt.c index 47e6b540dba..7221f5a80f4 100644 --- a/subsys/bluetooth/shell/bt.c +++ b/subsys/bluetooth/shell/bt.c @@ -2983,7 +2983,7 @@ static void auth_pairing_oob_data_request(struct bt_conn *conn, : NULL; if (oobd_remote && - bt_addr_le_cmp(info.le.remote, &oob_remote.addr)) { + !bt_addr_le_eq(info.le.remote, &oob_remote.addr)) { bt_addr_le_to_str(info.le.remote, addr, sizeof(addr)); shell_print(ctx_shell, "No OOB data available for remote %s", @@ -2993,7 +2993,7 @@ static void auth_pairing_oob_data_request(struct bt_conn *conn, } if (oobd_local && - bt_addr_le_cmp(info.le.local, &oob_local.addr)) { + !bt_addr_le_eq(info.le.local, &oob_local.addr)) { bt_addr_le_to_str(info.le.local, addr, sizeof(addr)); shell_print(ctx_shell, "No OOB data available for local %s", diff --git a/tests/bluetooth/tester/src/gap.c b/tests/bluetooth/tester/src/gap.c index 63886daf934..3c27453368d 100644 --- a/tests/bluetooth/tester/src/gap.c +++ b/tests/bluetooth/tester/src/gap.c @@ -375,7 +375,7 @@ static void oob_data_request(struct bt_conn *conn, } if (oobd_local && - bt_addr_le_cmp(info.le.local, &oob_sc_local.addr)) { + !bt_addr_le_eq(info.le.local, &oob_sc_local.addr)) { bt_addr_le_to_str(info.le.local, addr, sizeof(addr)); LOG_DBG("No OOB data available for local %s", addr); @@ -725,7 +725,7 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t evtype, * Advertisement, but if not if send stored event and ignore * this one */ - if (bt_addr_le_cmp(addr, &a)) { + if (!bt_addr_le_eq(addr, &a)) { LOG_INF("Address does not match, skipping"); goto done; }