aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2011-10-27 17:42:24 +0200
committerWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2011-10-27 17:42:24 +0200
commit5070211d091e3fb18f881835b66b1e52d52160c1 (patch)
tree86105cb6e9ccacac495561d82376c8dc598f8f76
parent3a9ad7c595d2b7e892d2eb6e1e39d789e3e0f575 (diff)
downloadPyPhytron-5070211d091e3fb18f881835b66b1e52d52160c1.tar.gz
PyPhytron-5070211d091e3fb18f881835b66b1e52d52160c1.tar.bz2
low level protocol stack finished
-rw-r--r--Phytron.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Phytron.py b/Phytron.py
index 406913b..bb84003 100644
--- a/Phytron.py
+++ b/Phytron.py
@@ -9,7 +9,7 @@ class ReceiveChecksumError(exceptions.Exception):
self.received = received
self.message = "Checksum Error: expected %x, got %x" % (expected, received)
-class OverrunError(exceptions.EnvironmentError):
+class RXBufferOverrunError(exceptions.EnvironmentError):
pass
class NotNowWarning(exceptions.UserWarning):
@@ -136,7 +136,7 @@ class ExtendedStatus:
self.busy = not not (bitvector & ExtendedStatus.BUSY)
self.programing_error = not not (bitvector & ExtendedStatus.PROGRAMING_ERROR)
self.high_temperature = not not (bitvector & ExtendedStatus.HIGH_TEMPERATURE)
- self.initiator_error = not not (bitvector & ExtendedStatus,INITIATOR_ERROR)
+ self.initiator_error = not not (bitvector & ExtendedStatus.INITIATOR_ERROR)
self.internal_error = not not (bitvector & ExtendedStatus.INTERNAL_ERROR)
self.driver_error = not not (bitvector & ExtendedStatus.DRIVER_ERROR)
self.wait_for_sync = not not (bitvector & ExtendedStatus.WAIT_FOR_SYNC)
@@ -236,7 +236,7 @@ class IPCOMM:
self.send( ('%X' % ID) + 'R')
if recv_data.status.rx_error:
- extended_status = self.queryextendedstatus(ID)
+ extended_status = self.queryextendedstatus(ID).data
if extended_status.checksum_error:
self.conn.flushInput()
@@ -244,19 +244,19 @@ class IPCOMM:
recv_data = None
continue
- if extended_status.overrun:
- raise OverrunError()
+ if extended_status.rxbuffer_overrun:
+ raise RXBufferOverrunError()
if extended_status.not_now:
raise NotNowWarning()
- if extended_status.unknown():
+ if extended_status.unknown_command:
raise UnknownCommand()
if extended_status.bad_value:
raise BadValueError()
- if extended_status.parameter_limits():
+ if extended_status.parameter_limits:
raise ParameterLimitsError()