Skip to content

Commit

Permalink
Delete unused "run immediately" function of BGAPI backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
peplin committed Sep 2, 2015
1 parent 26e5731 commit 2ecb322
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions pygatt/backends/bgapi/bgapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,18 @@ class BGAPIBackend(BLEBackend):
This object is NOT threadsafe.
"""
def __init__(self, serial_port=None, run=True):
def __init__(self, serial_port):
"""
Initialize the BGAPI device to be ready for use with a BLE device, i.e.,
stop ongoing procedures, disconnect any connections, optionally start
the receiver thread, and optionally delete any stored bonds.
serial_port -- The name of the serial port that the dongle is connected
to - if not provided, will attempt to find one matching
the common BLED112's USB device ID.
run -- begin reveiving packets immediately.
logfile -- the file to log to.
serial_port -- The name of the serial port for the BGAPI-compatible
USB interface.
"""
self._lib = bglib.BGLib()
if serial_port is None:
loginfo("Auto-discovering serial port for BLED112")
log.info("Auto-discovering serial port for BLED112")
detected_devices = find_usb_serial_devices(
vendor_id=BLED112_VENDOR_ID,
product_id=BLED112_PRODUCT_ID)
Expand Down Expand Up @@ -152,8 +149,6 @@ def __init__(self, serial_port=None, run=True):
}

log.info("Initialized new BGAPI backend on %s", serial_port)
if run:
self.run()

def bond(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/bgapi/test_bgapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class BGAPIBackendTests(unittest.TestCase):
def setUp(self):
self.mock_device = MockBGAPISerialDevice()
self.backend = BGAPIBackend(
serial_port=self.mock_device.serial_port_name, run=False)
serial_port=self.mock_device.serial_port_name)

self.address = [0x01, 0x23, 0x45, 0x67, 0x89, 0xAB]
self.address_string = ":".join("%02x" % b for b in self.address)
Expand Down

0 comments on commit 2ecb322

Please sign in to comment.