aboutsummaryrefslogtreecommitdiff
path: root/parrot_zik
diff options
context:
space:
mode:
Diffstat (limited to 'parrot_zik')
-rw-r--r--parrot_zik/bluetooth_paired_devices.py2
-rw-r--r--parrot_zik/message.py4
-rwxr-xr-xparrot_zik/parrot_zik_tray.py16
-rw-r--r--parrot_zik/resource_manager.py2
4 files changed, 12 insertions, 12 deletions
diff --git a/parrot_zik/bluetooth_paired_devices.py b/parrot_zik/bluetooth_paired_devices.py
index 5f5d443..626c5e6 100644
--- a/parrot_zik/bluetooth_paired_devices.py
+++ b/parrot_zik/bluetooth_paired_devices.py
@@ -59,7 +59,7 @@ class BluetoothCmdDeviceManager(BluetoothDeviceManager):
def get_mac(self):
pipe = Popen(['bluetoothctl'], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
- res = pipe.communicate("exit")
+ res = str(pipe.communicate("exit".encode("UTF-8")))
if len(res) > 0 and res[0]:
match = p.search(res[0])
if match:
diff --git a/parrot_zik/message.py b/parrot_zik/message.py
index 214b6f9..822e057 100644
--- a/parrot_zik/message.py
+++ b/parrot_zik/message.py
@@ -11,14 +11,14 @@ class Message:
def request(self):
message = bytearray()
message.extend(self.header)
- message.extend(bytearray(self.request_string))
+ message.extend(bytearray(self.request_string, 'utf-8'))
return message
@property
def header(self):
header = bytearray([0])
header.append(len(self.request_string) + 3)
- header.append("\x80")
+ header.append(0x80)
return header
@property
diff --git a/parrot_zik/parrot_zik_tray.py b/parrot_zik/parrot_zik_tray.py
index 35931d7..b5fab68 100755
--- a/parrot_zik/parrot_zik_tray.py
+++ b/parrot_zik/parrot_zik_tray.py
@@ -1,11 +1,11 @@
-from parrot_zik.interface.version1 import ParrotZikVersion1Interface
-from parrot_zik.interface.version2 import ParrotZikVersion2Interface
-from parrot_zik import resource_manager
-from parrot_zik import bluetooth_paired_devices
-from parrot_zik.indicator import MenuItem
-from parrot_zik.indicator import Menu
-from parrot_zik.indicator import SysIndicator
-from parrot_zik.utils import repeat
+from interface.version1 import ParrotZikVersion1Interface
+from interface.version2 import ParrotZikVersion2Interface
+import resource_manager
+import bluetooth_paired_devices
+from indicator import MenuItem
+from indicator import Menu
+from indicator import SysIndicator
+from utils import repeat
REFRESH_FREQUENCY = 30000
RECONNECT_FREQUENCY = 5000
diff --git a/parrot_zik/resource_manager.py b/parrot_zik/resource_manager.py
index aa141cb..cd358e1 100644
--- a/parrot_zik/resource_manager.py
+++ b/parrot_zik/resource_manager.py
@@ -45,7 +45,7 @@ class ResourceManagerBase(object):
def send_message(self, message):
try:
- self.sock.send(str(message))
+ self.sock.send(bytes(message.request))
return self.get_answer(message)
except bluetooth.btcommon.BluetoothError:
raise DeviceDisconnected