Browse Source

Standardized on a single argument for events for now.

pyserial_fix
Scott Petersen 11 years ago
parent
commit
0f24cb3c5d
2 changed files with 5 additions and 5 deletions
  1. +2
    -2
      pyad2usb/ad2usb.py
  2. +3
    -3
      pyad2usb/devices.py

+ 2
- 2
pyad2usb/ad2usb.py View File

@@ -421,12 +421,12 @@ class AD2USB(object):
args = (msg.partition, msg.event_type, msg.event_data)
if msg._event_type == 'ALARM_PANIC':
self._panic_status = True
self.on_panic(args + (True,))
self.on_panic(True)

elif msg._event_type == 'CANCEL':
if self._panic_status == True:
self._panic_status = False
self.on_panic(args + (False,))
self.on_panic(False)

self.on_lrr_message(args)



+ 3
- 3
pyad2usb/devices.py View File

@@ -271,7 +271,7 @@ class USBDevice(Device):
if not no_reader_thread:
self._read_thread.start()

self.on_open((self._serial_number, self._description))
self.on_open()

def close(self):
"""
@@ -489,7 +489,7 @@ class SerialDevice(Device):

else:
self._running = True
self.on_open(('N/A', "AD2SERIAL"))
self.on_open()

if not no_reader_thread:
self._read_thread.start()
@@ -751,7 +751,7 @@ class SocketDevice(Device):
else:
self._running = True

self.on_open(('N/A', "AD2SOCKET"))
self.on_open()

if not no_reader_thread:
self._read_thread.start()


Loading…
Cancel
Save