Lines Matching +full:0 +full:x00 +full:- +full:positive
8 * SPDX-License-Identifier: Apache-2.0
29 #define BT_ADDR_LE_PUBLIC 0x00
30 #define BT_ADDR_LE_RANDOM 0x01
31 #define BT_ADDR_LE_PUBLIC_ID 0x02
32 #define BT_ADDR_LE_RANDOM_ID 0x03
33 #define BT_ADDR_LE_UNRESOLVED 0xFE /* Resolvable Private Address
36 #define BT_ADDR_LE_ANONYMOUS 0xFF /* No address provided
78 * @return negative value if @a a < @a b, 0 if @a a == @a b, else positive
92 return bt_addr_cmp(a, b) == 0; in bt_addr_eq()
100 * @return negative value if @a a < @a b, 0 if @a a == @a b, else positive
112 * the 48-bit addresses are numerically equal.
119 return bt_addr_le_cmp(a, b) == 0; in bt_addr_le_eq()
143 #define BT_ADDR_IS_RPA(a) (((a)->val[5] & 0xc0) == 0x40)
144 /** Check if a Bluetooth LE random address is a non-resolvable private address.
146 #define BT_ADDR_IS_NRPA(a) (((a)->val[5] & 0xc0) == 0x00)
148 #define BT_ADDR_IS_STATIC(a) (((a)->val[5] & 0xc0) == 0xc0)
151 #define BT_ADDR_SET_RPA(a) ((a)->val[5] = (((a)->val[5] & 0x3f) | 0x40))
152 /** Set a Bluetooth LE random address as a non-resolvable private address. */
153 #define BT_ADDR_SET_NRPA(a) ((a)->val[5] &= 0x3f)
155 #define BT_ADDR_SET_STATIC(a) ((a)->val[5] |= 0xc0)
157 /** @brief Create a Bluetooth LE random non-resolvable private address. */
172 if (addr->type != BT_ADDR_LE_RANDOM) { in bt_addr_le_is_rpa()
176 return BT_ADDR_IS_RPA(&addr->a); in bt_addr_le_is_rpa()
190 if (addr->type == BT_ADDR_LE_PUBLIC) { in bt_addr_le_is_identity()
194 return BT_ADDR_IS_STATIC(&addr->a); in bt_addr_le_is_identity()
228 addr->val[5], addr->val[4], addr->val[3], in bt_addr_to_str()
229 addr->val[2], addr->val[1], addr->val[0]); in bt_addr_to_str()
247 switch (addr->type) { in bt_addr_le_to_str()
255 strcpy(type, "public-id"); in bt_addr_le_to_str()
258 strcpy(type, "random-id"); in bt_addr_le_to_str()
261 snprintk(type, sizeof(type), "0x%02x", addr->type); in bt_addr_le_to_str()
266 addr->a.val[5], addr->a.val[4], addr->a.val[3], in bt_addr_le_to_str()
267 addr->a.val[2], addr->a.val[1], addr->a.val[0], type); in bt_addr_le_to_str()
275 * @retval 0 Success. The parsed address is stored in @p addr.
276 * @return -EINVAL Invalid address string. @p str is not a well-formed Bluetooth address.