diff --git a/apps/btshell/src/cmd.c b/apps/btshell/src/cmd.c index 66f94fc4a..57d18acd3 100644 --- a/apps/btshell/src/cmd.c +++ b/apps/btshell/src/cmd.c @@ -1382,7 +1382,7 @@ cmd_set_addr(void) } switch (addr_type) { -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) case BLE_ADDR_PUBLIC: /* We shouldn't be writing to the controller's address (g_dev_addr). * There is no standard way to set the local public address, so this is diff --git a/nimble/host/src/ble_hs_hci_cmd.c b/nimble/host/src/ble_hs_hci_cmd.c index 7181c9a95..47eea6df0 100644 --- a/nimble/host/src/ble_hs_hci_cmd.c +++ b/nimble/host/src/ble_hs_hci_cmd.c @@ -175,7 +175,7 @@ ble_hs_hci_cmd_body_le_set_adv_params(const struct hci_adv_params *adv, /* When build with nimBLE controller we know it is BT5 compliant so no need * to limit non-connectable advertising interval */ -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) itvl = BLE_HCI_ADV_ITVL_MIN; #else /* Make sure interval is valid for advertising type. */ diff --git a/nimble/host/src/ble_hs_startup.c b/nimble/host/src/ble_hs_startup.c index 00a0f86ef..2253e6382 100644 --- a/nimble/host/src/ble_hs_startup.c +++ b/nimble/host/src/ble_hs_startup.c @@ -23,7 +23,7 @@ #include "host/ble_hs_hci.h" #include "ble_hs_priv.h" -#if !MYNEWT_VAL(BLE_DEVICE) +#if !MYNEWT_VAL(BLE_CONTROLLER) static int ble_hs_startup_read_sup_f_tx(void) { @@ -351,7 +351,7 @@ ble_hs_startup_go(void) /* XXX: Read local supported commands. */ /* we need to check this only if using external controller */ -#if !MYNEWT_VAL(BLE_DEVICE) +#if !MYNEWT_VAL(BLE_CONTROLLER) if (ble_hs_hci_get_hci_version() < BLE_HCI_VER_BCS_4_0) { BLE_HS_LOG(ERROR, "Required controller version is 4.0 (6)\n"); return BLE_HS_ECONTROLLER; diff --git a/nimble/host/util/src/addr.c b/nimble/host/util/src/addr.c index 58dcb182d..9b43d237c 100644 --- a/nimble/host/util/src/addr.c +++ b/nimble/host/util/src/addr.c @@ -20,7 +20,7 @@ #include "host/ble_hs.h" #include "host/util/util.h" -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) #include "controller/ble_hw.h" #endif @@ -31,7 +31,7 @@ ble_hs_util_load_rand_addr(ble_addr_t *addr) * is in the controller package. A host-only device ought to be able to * automically restore a random address. */ -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) int rc; rc = ble_hw_get_static_addr(addr); diff --git a/nimble/transport/socket/src/ble_hci_socket.c b/nimble/transport/socket/src/ble_hci_socket.c index a23b1bea2..e24877b7e 100644 --- a/nimble/transport/socket/src/ble_hci_socket.c +++ b/nimble/transport/socket/src/ble_hci_socket.c @@ -344,7 +344,7 @@ ble_hci_sock_rx_msg(void) while (bhss->rx_off > 0) { switch (bhss->rx_data[0]) { -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) case BLE_HCI_UART_H4_CMD: if (bhss->rx_off < BLE_HCI_CMD_HDR_LEN) { return -1; diff --git a/nimble/transport/uart/src/ble_hci_uart.c b/nimble/transport/uart/src/ble_hci_uart.c index dceeb3477..4b0d0a1ca 100644 --- a/nimble/transport/uart/src/ble_hci_uart.c +++ b/nimble/transport/uart/src/ble_hci_uart.c @@ -53,7 +53,7 @@ */ /* XXX: for now, define this here */ -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) extern void ble_ll_data_buffer_overflow(void); extern void ble_ll_hw_error(uint8_t err); @@ -193,7 +193,7 @@ ble_hci_trans_acl_buf_alloc(void) struct os_mbuf *m; uint8_t usrhdr_len; -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) usrhdr_len = sizeof(struct ble_mbuf_hdr); #elif MYNEWT_VAL(BLE_HS_FLOW_CTRL) usrhdr_len = BLE_MBUF_HS_HDR_LEN; @@ -387,7 +387,7 @@ ble_hci_uart_tx_char(void *arg) return rc; } -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) /** * HCI uart sync lost. * @@ -420,7 +420,7 @@ ble_hci_uart_rx_pkt_type(uint8_t data) switch (ble_hci_uart_state.rx_type) { /* Host should never receive a command! */ -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) case BLE_HCI_UART_H4_CMD: ble_hci_uart_state.rx_cmd.len = 0; ble_hci_uart_state.rx_cmd.cur = 0; @@ -460,7 +460,7 @@ ble_hci_uart_rx_pkt_type(uint8_t data) break; default: -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) /* * If we receive an unknown HCI packet type this is considered a loss * of sync. @@ -479,7 +479,7 @@ ble_hci_uart_rx_pkt_type(uint8_t data) return 0; } -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) /** * HCI uart sync loss. * @@ -710,7 +710,7 @@ ble_hci_uart_rx_acl(uint8_t data) */ if (pktlen > MYNEWT_VAL(BLE_ACL_BUF_SIZE)) { os_mbuf_free_chain(ble_hci_uart_state.rx_acl.buf); -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) ble_hci_uart_sync_lost(); #else /* @@ -756,7 +756,7 @@ ble_hci_uart_rx_skip_acl(uint8_t data) if (rxd_bytes == ble_hci_uart_state.rx_acl.len) { /* XXX: I dont like this but for now this denotes controller only */ -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) ble_ll_data_buffer_overflow(); #endif ble_hci_uart_state.rx_type = BLE_HCI_UART_H4_NONE; @@ -769,7 +769,7 @@ ble_hci_uart_rx_char(void *arg, uint8_t data) switch (ble_hci_uart_state.rx_type) { case BLE_HCI_UART_H4_NONE: return ble_hci_uart_rx_pkt_type(data); -#if MYNEWT_VAL(BLE_DEVICE) +#if MYNEWT_VAL(BLE_CONTROLLER) case BLE_HCI_UART_H4_CMD: ble_hci_uart_rx_cmd(data); return 0; diff --git a/porting/examples/linux/include/syscfg/syscfg.h b/porting/examples/linux/include/syscfg/syscfg.h index 01eeb2dc1..74abbcba6 100644 --- a/porting/examples/linux/include/syscfg/syscfg.h +++ b/porting/examples/linux/include/syscfg/syscfg.h @@ -272,8 +272,8 @@ #endif /*** net/nimble/controller */ -#ifndef MYNEWT_VAL_BLE_DEVICE -#define MYNEWT_VAL_BLE_DEVICE (0) +#ifndef MYNEWT_VAL_BLE_CONTROLLER +#define MYNEWT_VAL_BLE_CONTROLLER (0) #endif #ifndef MYNEWT_VAL_BLE_PUBLIC_DEV_ADDR diff --git a/porting/examples/linux_blemesh/include/syscfg/syscfg.h b/porting/examples/linux_blemesh/include/syscfg/syscfg.h index 82944eff9..0d2dbe3af 100644 --- a/porting/examples/linux_blemesh/include/syscfg/syscfg.h +++ b/porting/examples/linux_blemesh/include/syscfg/syscfg.h @@ -272,8 +272,8 @@ #endif /*** net/nimble/controller */ -#ifndef MYNEWT_VAL_BLE_DEVICE -#define MYNEWT_VAL_BLE_DEVICE (0) +#ifndef MYNEWT_VAL_BLE_CONTROLLER +#define MYNEWT_VAL_BLE_CONTROLLER (0) #endif #ifndef MYNEWT_VAL_BLE_PUBLIC_DEV_ADDR diff --git a/porting/npl/riot/include/syscfg/syscfg.h b/porting/npl/riot/include/syscfg/syscfg.h index d007a520c..4019f329b 100644 --- a/porting/npl/riot/include/syscfg/syscfg.h +++ b/porting/npl/riot/include/syscfg/syscfg.h @@ -435,8 +435,8 @@ #endif /*** nimble/controller */ -#ifndef MYNEWT_VAL_BLE_DEVICE -#define MYNEWT_VAL_BLE_DEVICE (1) +#ifndef MYNEWT_VAL_BLE_CONTROLLER +#define MYNEWT_VAL_BLE_CONTROLLER (1) #endif /* Overridden by nimble/controller (defined by nimble/controller) */