Skip to content

Commit

Permalink
[TESTS] Add support for socket in injector class
Browse files Browse the repository at this point in the history
  • Loading branch information
darthcloud committed Jan 28, 2023
1 parent 6d498d5 commit 7b5df4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/injector.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3

import struct
from serial import Serial
from serial import serial_for_url
from time import sleep


class BlueRetroInjector:
def __init__(self, dev="/dev/ttyUSB1", handle=0):
self.fd = Serial(port=dev, baudrate=921600, timeout=1)
def __init__(self, dev="socket://localhost:5555", handle=0):
self.fd = serial_for_url(url=dev, baudrate=921600, timeout=1)
self.handle = handle

def __write(self, cmd, handle, data=b''):
Expand Down Expand Up @@ -62,7 +62,7 @@ def main():
'8103c0'
hid_report = 'a1010000500000000000'

bri = BlueRetroInjector()
bri = BlueRetroInjector(dev="/dev/ttyUSB1")

bri.connect()

Expand Down

0 comments on commit 7b5df4f

Please sign in to comment.