nimble/ll: Add helper to check if addr is identity

This commit is contained in:
Andrzej Kaczmarek
2019-06-17 16:04:58 +02:00
parent 96337643ea
commit f1e9720bc3
2 changed files with 9 additions and 0 deletions
@@ -438,6 +438,9 @@ uint16_t ble_ll_pdu_max_tx_octets_get(uint32_t usecs, int phy_mode);
/* Is this address a resolvable private address? */
int ble_ll_is_rpa(uint8_t *addr, uint8_t addr_type);
/* Is this address an identity address? */
int ble_ll_addr_is_id(uint8_t *addr, uint8_t addr_type);
/* Is 'addr' our device address? 'addr_type' is public (0) or random (!=0) */
int ble_ll_is_our_devaddr(uint8_t *addr, int addr_type);
+6
View File
@@ -426,6 +426,12 @@ ble_ll_is_rpa(uint8_t *addr, uint8_t addr_type)
return rc;
}
int
ble_ll_addr_is_id(uint8_t *addr, uint8_t addr_type)
{
return !addr_type || ((addr[5] & 0xc0) == 0xc0);
}
/* Checks to see that the device is a valid random address */
int
ble_ll_is_valid_random_addr(uint8_t *addr)