From d463690d07999f5578cdd0be20946beca4025285 Mon Sep 17 00:00:00 2001 From: Zhengyu Peng Date: Tue, 22 Feb 2022 16:49:27 -0500 Subject: [PATCH] Update btserver.py --- software/raspberry pi/btserver.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/software/raspberry pi/btserver.py b/software/raspberry pi/btserver.py index 921a76f..01d74cc 100644 --- a/software/raspberry pi/btserver.py +++ b/software/raspberry pi/btserver.py @@ -47,8 +47,15 @@ class BluetoothServer(Thread): with open('./config.json', 'r') as read_file: self.config = json.load(read_file) + # import commands + # cmd = "hciconfig" + # device_id = "hci0" + # status, output = commands.getstatusoutput(cmd) + # bt_mac = output.split("{}:".format(device_id))[1].split("BD Address: ")[1].split(" ")[0].strip() + # print bt_mac + self.mac = '192.168.1.127' - self.port = 1234 + self.port = 10 self.bt_socket = socket.socket( socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)