This is an automated email from the ASF dual-hosted git repository. andk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit f1e9720bc313fd2a3a3380dad9746abb338503ac Author: Andrzej Kaczmarek <[email protected]> AuthorDate: Mon Jun 17 15:27:57 2019 +0200 nimble/ll: Add helper to check if addr is identity --- nimble/controller/include/controller/ble_ll.h | 3 +++ nimble/controller/src/ble_ll.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/nimble/controller/include/controller/ble_ll.h b/nimble/controller/include/controller/ble_ll.h index 98ec8e3..c1ced36 100644 --- a/nimble/controller/include/controller/ble_ll.h +++ b/nimble/controller/include/controller/ble_ll.h @@ -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); diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c index e8bfd28..1b9639f 100644 --- a/nimble/controller/src/ble_ll.c +++ b/nimble/controller/src/ble_ll.c @@ -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)
