diff --git a/snippets/ev3/bluetooth_client/client.py b/snippets/ev3/bluetooth_client/client.py index 9fecc3e..4be2093 100644 --- a/snippets/ev3/bluetooth_client/client.py +++ b/snippets/ev3/bluetooth_client/client.py @@ -4,15 +4,16 @@ # paired using Bluetooth, but do NOT connect them. The program will take care # of establishing the connection. +# The server must be started before the client! + from pybricks.messaging import BluetoothMailboxClient, TextMailbox # This is the name of the remote EV3 we are connecting to. SERVER = 'ev3dev' client = BluetoothMailboxClient() -mbox = TextMailbox('mbox', client) +mbox = TextMailbox('greeting', client) -# The server must be started before the client! print('establishing connection...') client.connect(SERVER) print('connected!') diff --git a/snippets/ev3/bluetooth_server/server.py b/snippets/ev3/bluetooth_server/server.py index 7ef9e44..9f325ee 100644 --- a/snippets/ev3/bluetooth_server/server.py +++ b/snippets/ev3/bluetooth_server/server.py @@ -4,10 +4,12 @@ # paired using Bluetooth, but do NOT connect them. The program will take care # of establishing the connection. +# The server must be started before the client! + from pybricks.messaging import BluetoothMailboxServer, TextMailbox server = BluetoothMailboxServer() -mbox = TextMailbox('mbox', server) +mbox = TextMailbox('greeting', server) # The server must be started before the client! print('waiting for connection...') @@ -18,4 +20,4 @@ print('connected!') # and then sends a reply. mbox.wait() print(mbox.read()) -mbox.send('hello to you too!') +mbox.send('hello to you!')