Skip to content

Commit b3c6702

Browse files
committed
pbio/drv/bluetooth_btstack: Add poll hook.
This is needed for the POSIX port, which needs to poll files.
1 parent fb0a244 commit b3c6702

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

lib/pbio/drv/bluetooth/bluetooth_btstack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,8 @@ static pbio_error_t pbdrv_bluetooth_hci_process_thread(pbio_os_state_t *state, v
10351035
btstack_run_loop_base_poll_data_sources();
10361036
}
10371037

1038+
pbdrv_bluetooth_btstack_platform_poll();
1039+
10381040
static pbio_os_timer_t btstack_timer = {
10391041
.duration = 1,
10401042
};

lib/pbio/drv/bluetooth/bluetooth_btstack.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
*/
2323
pbio_error_t pbdrv_bluetooth_btstack_platform_init(void);
2424

25+
/**
26+
* Optional platform poll handler, called on every process iteration.
27+
*/
28+
void pbdrv_bluetooth_btstack_platform_poll(void);
29+
2530
/** Chipset info */
2631
typedef struct {
2732
/** Version */

lib/pbio/drv/bluetooth/bluetooth_btstack_ev3.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ pbio_error_t pbdrv_bluetooth_btstack_platform_init(void) {
7070
return PBIO_SUCCESS;
7171
}
7272

73+
void pbdrv_bluetooth_btstack_platform_poll(void) {
74+
}
75+
7376
void pbdrv_bluetooth_btstack_set_chipset(uint16_t lmp_pal_subversion) {
7477
const pbdrv_bluetooth_btstack_chipset_info_t *info = lmp_pal_subversion == cc2560_info.lmp_version ?
7578
&cc2560_info : &cc2560a_info;

lib/pbio/drv/bluetooth/bluetooth_btstack_stm32_hal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ pbio_error_t pbdrv_bluetooth_btstack_platform_init(void) {
3030
return PBIO_SUCCESS;
3131
}
3232

33+
void pbdrv_bluetooth_btstack_platform_poll(void) {
34+
}
35+
3336
void pbdrv_bluetooth_btstack_set_chipset(uint16_t lmp_pal_subversion) {
3437

3538
const pbdrv_bluetooth_btstack_platform_data_t *pdata =

lib/pbio/test/drv/test_bluetooth_btstack.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,9 @@ pbio_error_t pbdrv_bluetooth_btstack_platform_init(void) {
777777
return PBIO_SUCCESS;
778778
}
779779

780+
void pbdrv_bluetooth_btstack_platform_poll(void) {
781+
}
782+
780783
static pbio_error_t test_btstack_run_loop_contiki_poll(pbio_os_state_t *state, void *context) {
781784
static btstack_data_source_t data_source;
782785
static uint32_t callback_count;

0 commit comments

Comments
 (0)