Created
May 24, 2017 22:11
-
-
Save MeanEYE/74c65a86254f9d13462326ab1f01a273 to your computer and use it in GitHub Desktop.
Silly Bluetooth raw text dump.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import bluetooth | |
socket = bluetooth.BluetoothSocket(bluetooth.RFCOMM) | |
socket.connect(('00:00:00:00:00:00', 1)) | |
data = socket.recv(4096) | |
while data: | |
lines = data.split('$') | |
data = lines[-1] + socket.recv(4096) | |
lines = lines[:-1] | |
if len(lines) > 0: | |
for line in lines: | |
print line.strip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment