Skip to content

Commit

Permalink
Merge branch 'plugfest-rdm' of https://github.com/peternewman/ola int…
Browse files Browse the repository at this point in the history
…o plugfest-rdm
  • Loading branch information
peternewman committed Dec 12, 2018
2 parents 96cec5a + aac6e1a commit 0aa60a9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/rdm/ModelCollector.py
Expand Up @@ -71,6 +71,7 @@ def Run(self, universe, skip_queued_messages):
self.skip_queued_messages = skip_queued_messages
self._ResetData()

logging.debug('Running RDM discovery on universe %d' % self.universe)
self.client.RunRDMDiscovery(self.universe, True, self._HandleUIDList)
self.wrapper.Run()

Expand Down Expand Up @@ -136,6 +137,7 @@ def _GetPid(self, pid):

def _HandleUIDList(self, state, uids):
"""Called when the UID list arrives."""
logging.debug('RDM discovery complete for universe %d' % self.universe)
if not state.Succeeded():
raise DiscoveryException(state.message)

Expand All @@ -148,7 +150,8 @@ def _HandleUIDList(self, state, uids):
self._FetchNextUID()

def _HandleResponse(self, unpacked_data):
logging.debug(unpacked_data)
if unpacked_data:
logging.debug(unpacked_data)
if self.work_state == self.DEVICE_INFO:
self._HandleDeviceInfo(unpacked_data)
elif self.work_state == self.DEVICE_LABEL:
Expand Down Expand Up @@ -586,7 +589,7 @@ def _QueuedMessageComplete(self, response, unpacked_data, unpack_exception):
self._NextState()
return

logging.debug('Got pid 0x%hx' % response.pid)
logging.debug('Got pid %#04hx' % response.pid)
if self.outstanding_pid and response.pid == self.outstanding_pid.value:
self._HandleResponse(unpacked_data)
else:
Expand All @@ -599,7 +602,7 @@ def _CheckForAckOrNack(self, response):
True if this response was an ACK or NACK, False for all other cases.
"""
if not response.status.Succeeded():
print response.status.message
print ('Status: %s' % response.status.message)
self.wrapper.Stop()
return False

Expand Down

0 comments on commit 0aa60a9

Please sign in to comment.