Bluetooth: controller: Rename ll_address_* to ll_addr_*
Rename ll_address_* to ll_addr_*. Also, update ll_addr_get to return reference to stored public or random address. Change-id: I22cb0135d2223f679c4d9321f4724f8b7de0aede Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
This commit is contained in:
parent
c8cb20a5b8
commit
b29b3e2fdb
3 changed files with 19 additions and 11 deletions
|
@ -273,7 +273,7 @@ static void read_bd_addr(struct net_buf *buf, struct net_buf **evt)
|
|||
rp = cmd_complete(evt, sizeof(*rp));
|
||||
|
||||
rp->status = 0x00;
|
||||
ll_address_get(0, &rp->bdaddr.val[0]);
|
||||
ll_addr_get(0, &rp->bdaddr.val[0]);
|
||||
}
|
||||
|
||||
static int info_cmd_handle(u8_t ocf, struct net_buf *cmd,
|
||||
|
@ -345,7 +345,7 @@ static void le_set_random_address(struct net_buf *buf, struct net_buf **evt)
|
|||
struct bt_hci_cp_le_set_random_address *cmd = (void *)buf->data;
|
||||
struct bt_hci_evt_cc_status *ccst;
|
||||
|
||||
ll_address_set(1, &cmd->bdaddr.val[0]);
|
||||
ll_addr_set(1, &cmd->bdaddr.val[0]);
|
||||
|
||||
ccst = cmd_complete(evt, sizeof(*ccst));
|
||||
ccst->status = 0x00;
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
int ll_init(struct k_sem *sem_rx);
|
||||
void ll_reset(void);
|
||||
void ll_address_get(u8_t addr_type, u8_t *p_bdaddr);
|
||||
void ll_address_set(u8_t addr_type, u8_t const *const p_bdaddr);
|
||||
u8_t *ll_addr_get(u8_t addr_type, u8_t *p_bdaddr);
|
||||
void ll_addr_set(u8_t addr_type, u8_t const *const p_bdaddr);
|
||||
void ll_adv_params_set(u16_t interval, u8_t adv_type,
|
||||
u8_t own_addr_type, u8_t direct_addr_type,
|
||||
u8_t const *const p_direct_addr, u8_t chl_map,
|
||||
|
|
|
@ -246,21 +246,29 @@ int ll_init(struct k_sem *sem_rx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void ll_address_get(u8_t addr_type, u8_t *bdaddr)
|
||||
u8_t *ll_addr_get(u8_t addr_type, u8_t *bdaddr)
|
||||
{
|
||||
if (addr_type) {
|
||||
memcpy(bdaddr, &_ll_context.rnd_addr[0], BDADDR_SIZE);
|
||||
} else {
|
||||
memcpy(bdaddr, &_ll_context.pub_addr[0], BDADDR_SIZE);
|
||||
if (bdaddr) {
|
||||
memcpy(bdaddr, _ll_context.rnd_addr, BDADDR_SIZE);
|
||||
}
|
||||
|
||||
return _ll_context.rnd_addr;
|
||||
}
|
||||
|
||||
if (bdaddr) {
|
||||
memcpy(bdaddr, _ll_context.pub_addr, BDADDR_SIZE);
|
||||
}
|
||||
|
||||
return _ll_context.pub_addr;
|
||||
}
|
||||
|
||||
void ll_address_set(u8_t addr_type, u8_t const *const bdaddr)
|
||||
void ll_addr_set(u8_t addr_type, u8_t const *const bdaddr)
|
||||
{
|
||||
if (addr_type) {
|
||||
memcpy(&_ll_context.rnd_addr[0], bdaddr, BDADDR_SIZE);
|
||||
memcpy(_ll_context.rnd_addr, bdaddr, BDADDR_SIZE);
|
||||
} else {
|
||||
memcpy(&_ll_context.pub_addr[0], bdaddr, BDADDR_SIZE);
|
||||
memcpy(_ll_context.pub_addr, bdaddr, BDADDR_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue