Lines Matching refs:addr
19 static inline int create_random_addr(bt_addr_le_t *addr) in create_random_addr() argument
21 addr->type = BT_ADDR_LE_RANDOM; in create_random_addr()
23 return bt_rand(addr->a.val, 6); in create_random_addr()
26 int bt_addr_le_create_nrpa(bt_addr_le_t *addr) in bt_addr_le_create_nrpa() argument
30 err = create_random_addr(addr); in bt_addr_le_create_nrpa()
35 BT_ADDR_SET_NRPA(&addr->a); in bt_addr_le_create_nrpa()
40 int bt_addr_le_create_static(bt_addr_le_t *addr) in bt_addr_le_create_static() argument
44 err = create_random_addr(addr); in bt_addr_le_create_static()
49 BT_ADDR_SET_STATIC(&addr->a); in bt_addr_le_create_static()
54 int bt_addr_from_str(const char *str, bt_addr_t *addr) in bt_addr_from_str() argument
77 for (size_t i = 0; i < ARRAY_SIZE(addr->val); i++) { in bt_addr_from_str()
78 const size_t reverse_i = ARRAY_SIZE(addr->val) - 1 - i; in bt_addr_from_str()
80 if (!hex2bin(&str[i * 3], 2, &addr->val[reverse_i], 1)) { in bt_addr_from_str()
88 int bt_addr_le_from_str(const char *str, const char *type, bt_addr_le_t *addr) in bt_addr_le_from_str() argument
92 err = bt_addr_from_str(str, &addr->a); in bt_addr_le_from_str()
98 addr->type = BT_ADDR_LE_PUBLIC; in bt_addr_le_from_str()
100 addr->type = BT_ADDR_LE_RANDOM; in bt_addr_le_from_str()
102 addr->type = BT_ADDR_LE_PUBLIC_ID; in bt_addr_le_from_str()
104 addr->type = BT_ADDR_LE_RANDOM_ID; in bt_addr_le_from_str()
119 bool bt_addr_le_is_resolved(const bt_addr_le_t *addr) in bt_addr_le_is_resolved() argument
121 return (addr->type & ADDR_RESOLVED_BITMASK) != 0; in bt_addr_le_is_resolved()