Skip to content

Instantly share code, notes, and snippets.

@MeanEYE
Created May 24, 2017 22:11
Show Gist options
  • Save MeanEYE/74c65a86254f9d13462326ab1f01a273 to your computer and use it in GitHub Desktop.
Save MeanEYE/74c65a86254f9d13462326ab1f01a273 to your computer and use it in GitHub Desktop.
Silly Bluetooth raw text dump.
#!/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