Bluetooth: controller: Conditional compile BT_LL_SW variant

Refactor Kconfig and CMakelists.txt to be able to
conditionally compile in BT_LL_SW variant in the controller
subsystem. This is done to support future controller with
vendor specific variant implementations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2018-01-09 15:17:15 +01:00 committed by Carles Cufí
commit 5b0cd2c69b
10 changed files with 153 additions and 80 deletions

View file

@ -0,0 +1,46 @@
/*
* Copyright (c) 2016-2018 Nordic Semiconductor ASA
* Copyright (c) 2016 Vinayak Kariappa Chettimada
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stddef.h>
#include <string.h>
#include <zephyr/types.h>
#include <toolchain.h>
#include "ll_sw/pdu.h"
static u8_t pub_addr[BDADDR_SIZE];
static u8_t rnd_addr[BDADDR_SIZE];
u8_t *ll_addr_get(u8_t addr_type, u8_t *bdaddr)
{
if (addr_type > 1) {
return NULL;
}
if (addr_type) {
if (bdaddr) {
memcpy(bdaddr, rnd_addr, BDADDR_SIZE);
}
return rnd_addr;
}
if (bdaddr) {
memcpy(bdaddr, pub_addr, BDADDR_SIZE);
}
return pub_addr;
}
void ll_addr_set(u8_t addr_type, u8_t const *const bdaddr)
{
if (addr_type) {
memcpy(rnd_addr, bdaddr, BDADDR_SIZE);
} else {
memcpy(pub_addr, bdaddr, BDADDR_SIZE);
}
}