Skip to content

Commit 39903d6

Browse files
committed
!deleteme: example and debugging
1 parent 0e4eef9 commit 39903d6

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

lib/pbio/drv/bluetooth/bluetooth_btstack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#define PERIPHERAL_TIMEOUT_MS_CONNECT (5000)
4848
#define PERIPHERAL_TIMEOUT_MS_PAIRING (5000)
4949

50-
#define DEBUG 0
50+
#define DEBUG 1
5151

5252
#if DEBUG
5353
#include <pbio/debug.h>

pybricks/messaging/pb_module_messaging.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <pybricks/util_pb/pb_error.h>
2626
#include <pybricks/tools/pb_type_async.h>
2727

28-
#define DEBUG 0
28+
#define DEBUG 1
2929

3030
#if DEBUG
3131
#include <pbio/debug.h>

tests/bluetooth/virtual0.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
from pybricks.hubs import VirtualHub
2-
from pybricks.tools import wait
1+
from pybricks.tools import run_task
2+
from pybricks.messaging import rfcomm_scan
33

4-
hub = VirtualHub(broadcast_channel=123)
54

6-
for i in range(99):
7-
hub.ble.broadcast(["Hello", i])
8-
wait(100)
5+
async def main():
6+
results = await rfcomm_scan(timeout=10000, num_results=10, verbose=True)
7+
print(results)
98

10-
hub.ble.broadcast(b"STOP")
11-
wait(500)
9+
10+
run_task(main())

0 commit comments

Comments
 (0)