Skip to content

Commit 390744d

Browse files
committed
transport: Bridge build workaround
Function ble_ll_data_buffer_overflow() and ble_ll_hw_error() are executed from host code, but those are controller functions. They would only work when host and controller runs on same CPU. In bridge build when controller code can't be executed this way two transports (nrf5340/dialog_cmac) provide those functions so UART can be used in bridge configuration. This is just workaround till functions are implemented or other way of signaling those errors is established.
1 parent 4386bb4 commit 390744d

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

nimble/transport/dialog_cmac/src/ble_hci_cmac_hs.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@ static struct ble_hci_cmac_hs_api g_ble_hci_cmac_hs_api;
4141
static struct ble_hci_trans_h4_rx_state g_ble_hci_cmac_hs_rx_state;
4242
static bool g_ble_hci_cmac_hs_read_err;
4343

44+
#if MYNEWT_VAL(BLE_HCI_BRIDGE)
45+
/*
46+
* TODO: Remove/fix functions ble_ll_data_buffer_overflow() ble_ll_hw_error()
47+
* Following two functions are added to allowed build of HCI bridge configurations.
48+
* Those functions are only used by UART transport, in RAM transport configuration
49+
* they can be called directly in bridge mode controller code is on other core
50+
* and those can't be called.
51+
*/
52+
void
53+
ble_ll_data_buffer_overflow(void)
54+
{
55+
56+
}
57+
58+
void
59+
ble_ll_hw_error(uint8_t err)
60+
{
61+
(void)err;
62+
}
63+
#endif
64+
4465
static int
4566
ble_hci_cmac_hs_frame_cb(uint8_t pkt_type, void *data)
4667
{

nimble/transport/nrf5340/src/nrf5340_ble_hci.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,27 @@ ble_hci_trans_reset(void)
123123
}
124124
#endif
125125

126+
#if MYNEWT_VAL(BLE_HCI_BRIDGE)
127+
/*
128+
* TODO: Remove/fix functions ble_ll_data_buffer_overflow() ble_ll_hw_error()
129+
* Following two functions are added to allowed build of HCI bridge configurations.
130+
* Those functions are only used by UART transport, in RAM transport configuration
131+
* they can be called directly in bridge mode controller code is on other core
132+
* and those can't be called.
133+
*/
134+
void
135+
ble_ll_data_buffer_overflow(void)
136+
{
137+
138+
}
139+
140+
void
141+
ble_ll_hw_error(uint8_t err)
142+
{
143+
(void)err;
144+
}
145+
#endif
146+
126147
static int
127148
ble_hci_trans_acl_tx(struct os_mbuf *om)
128149
{

nimble/transport/usb/pkg.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pkg.deps:
3131
- "@apache-mynewt-core/kernel/os"
3232
- "@apache-mynewt-core/util/mem"
3333
- nimble
34+
- "@apache-mynewt-core/hw/usb/tinyusb"
3435

3536
pkg.apis:
3637
- ble_transport

0 commit comments

Comments
 (0)