diff options
Diffstat (limited to 'mdb/device.py')
-rw-r--r-- | mdb/device.py | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/mdb/device.py b/mdb/device.py index 20ea546..6c27270 100644 --- a/mdb/device.py +++ b/mdb/device.py @@ -9,7 +9,7 @@ except ImportError: from mdb.utils import compute_checksum, compute_chk, bcd_decode from mdb.constants import * -from mdb.backend import RaspiBackend, DummyBackend, pigpio +from mdb.backend import RaspiBackend, DummyBackend, SerialBackend, pigpio class MDBRequest(object): timestamp = None @@ -64,7 +64,7 @@ class MDBDevice(object): self.backend = RaspiBackend() else: self.logger.warning('Running with dummy backend device') - self.backend = DummyBackend() + self.backend = SerialBackend() def initialize(self): self.logger.info('Initializing...') @@ -79,7 +79,8 @@ class MDBDevice(object): for b in range(0, len(data), 2): if data[b+1]: if self.current_request: # and not self.current_request.processed: - self.logger.debug(self.current_request) + if self.current_request.command not in [0xf2]: + self.logger.debug(self.current_request) if self.current_request.processed and self.current_request.ack: self.logger.info('Got response: %d',self.current_request.data[-1]) self.poll_msg = [] @@ -150,21 +151,21 @@ class CashlessMDBDevice(MDBDevice): def process_request(self, req): # FIXME this shouldn't be required... - if req.command == 0x30 and req.validate_checksum(): - self.lockup_counter += 1 - - if self.lockup_counter % 50 == 0: - self.logger.info('YOLO') - return [] - return - if req.command == 0x31 and req.validate_checksum(): - return [] - if req.command == 0x37 and req.validate_checksum(): - return [] - if req.command == 0x36 and req.validate_checksum(): - return [] - if req.command == 0x34 and req.validate_checksum(): - return [] + #if req.command == 0x30 and req.validate_checksum(): + # self.lockup_counter += 1 + + # if self.lockup_counter % 50 == 0: + # self.logger.info('YOLO') + # return [] + # return + #if req.command == 0x31 and req.validate_checksum(): + # return [] + #if req.command == 0x37 and req.validate_checksum(): + # return [] + #if req.command == 0x36 and req.validate_checksum(): + # return [] + #if req.command == 0x34 and req.validate_checksum(): + # return [] if (req.command & self.base_address) != self.base_address: # Target mismatch |