Skip to content

Commit 2db2ad1

Browse files
committed
bricks: Restrict RFCOMM to EV3 for now.
This has not been tested on SPIKE, so let's not include it in the beta release yet.
1 parent 1e0699b commit 2db2ad1

File tree

7 files changed

+12
-2
lines changed

7 files changed

+12
-2
lines changed

bricks/essentialhub/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#define PYBRICKS_PY_IODEVICES_UART_DEVICE (1)
4040
#define PYBRICKS_PY_IODEVICES_XBOX_CONTROLLER (1)
4141
#define PYBRICKS_PY_MESSAGING (1)
42+
#define PYBRICKS_PY_MESSAGING_RFCOMM (0)
4243
#define PYBRICKS_PY_NXTDEVICES (0)
4344
#define PYBRICKS_PY_PARAMETERS (1)
4445
#define PYBRICKS_PY_PARAMETERS_BUTTON (1)

bricks/ev3/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#define PYBRICKS_PY_IODEVICES_UART_DEVICE (1)
4444
#define PYBRICKS_PY_IODEVICES_XBOX_CONTROLLER (0)
4545
#define PYBRICKS_PY_MESSAGING (1)
46+
#define PYBRICKS_PY_MESSAGING_RFCOMM (1)
4647
#define PYBRICKS_PY_NXTDEVICES (1)
4748
#define PYBRICKS_PY_PARAMETERS (1)
4849
#define PYBRICKS_PY_PARAMETERS_BUTTON (1)

bricks/primehub/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define PYBRICKS_PY_IODEVICES_XBOX_CONTROLLER (1)
3737
#define PYBRICKS_PY_MEDIA_IMAGE (0)
3838
#define PYBRICKS_PY_MESSAGING (1)
39+
#define PYBRICKS_PY_MESSAGING_RFCOMM (0)
3940
#define PYBRICKS_PY_NXTDEVICES (0)
4041
#define PYBRICKS_PY_PARAMETERS (1)
4142
#define PYBRICKS_PY_PARAMETERS_BUTTON (1)

bricks/virtualhub/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#define PYBRICKS_PY_IODEVICES_UART_DEVICE (0)
4040
#define PYBRICKS_PY_IODEVICES_XBOX_CONTROLLER (1)
4141
#define PYBRICKS_PY_MESSAGING (1)
42+
#define PYBRICKS_PY_MESSAGING_RFCOMM (1)
4243
#define PYBRICKS_PY_NXTDEVICES (0)
4344
#define PYBRICKS_PY_PARAMETERS (1)
4445
#define PYBRICKS_PY_PARAMETERS_BUTTON (1)

lib/pbio/platform/essential_hub/pbdrvconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define PBDRV_CONFIG_BATTERY_ADC_TEMPERATURE_CH 2
2727

2828
#define PBDRV_CONFIG_BLUETOOTH (1)
29-
#define PBDRV_CONFIG_BLUETOOTH_NUM_CLASSIC_CONNECTIONS (2)
29+
#define PBDRV_CONFIG_BLUETOOTH_NUM_CLASSIC_CONNECTIONS (0)
3030
#define PBDRV_CONFIG_BLUETOOTH_NUM_PERIPHERALS (2)
3131
#define PBDRV_CONFIG_BLUETOOTH_MAX_MTU_SIZE 515
3232
#define PBDRV_CONFIG_BLUETOOTH_BTSTACK (1)

lib/pbio/platform/prime_hub/pbdrvconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define PBDRV_CONFIG_BATTERY_ADC_TEMPERATURE_CH 2
2727

2828
#define PBDRV_CONFIG_BLUETOOTH (1)
29-
#define PBDRV_CONFIG_BLUETOOTH_NUM_CLASSIC_CONNECTIONS (2)
29+
#define PBDRV_CONFIG_BLUETOOTH_NUM_CLASSIC_CONNECTIONS (0)
3030
#define PBDRV_CONFIG_BLUETOOTH_NUM_PERIPHERALS (2)
3131
#define PBDRV_CONFIG_BLUETOOTH_MAX_MTU_SIZE 515
3232
#define PBDRV_CONFIG_BLUETOOTH_BTSTACK (1)

pybricks/messaging/pb_module_messaging.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#define DEBUG_PRINT(...)
3535
#endif
3636

37+
#if PYBRICKS_PY_MESSAGING_RFCOMM
38+
3739
typedef struct {
3840
mp_obj_base_t base;
3941
uint32_t num_results;
@@ -125,9 +127,13 @@ static mp_obj_t pb_messaging_bluetooth_scan(size_t n_args, const mp_obj_t *pos_a
125127
// See also messaging_globals_table below. This function object is added there to make it importable.
126128
static MP_DEFINE_CONST_FUN_OBJ_KW(pb_messaging_bluetooth_scan_obj, 0, pb_messaging_bluetooth_scan);
127129

130+
#endif // PYBRICKS_PY_MESSAGING_RFCOMM
131+
128132
static const mp_rom_map_elem_t messaging_globals_table[] = {
129133
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_messaging) },
134+
#if PYBRICKS_PY_MESSAGING_RFCOMM
130135
{ MP_ROM_QSTR(MP_QSTR_bluetooth_scan), MP_ROM_PTR(&pb_messaging_bluetooth_scan_obj) },
136+
#endif // PYBRICKS_PY_MESSAGING_RFCOMM
131137
};
132138
static MP_DEFINE_CONST_DICT(pb_module_messaging_globals, messaging_globals_table);
133139

0 commit comments

Comments
 (0)