Skip to content

Commit

Permalink
Merge pull request #51 from spencerjackson/emptyServices
Browse files Browse the repository at this point in the history
Allow services to have empty requests
  • Loading branch information
PaulBouchier committed Jul 2, 2013
2 parents def0ad6 + 8fb301d commit 25e5a59
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rosserial_python/src/rosserial_python/SerialClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def callback(self, req):
data_buffer = StringIO.StringIO()
req.serialize(data_buffer)
self.response = None
if self.parent.send(self.id, data_buffer.getvalue()) > 0:
if self.parent.send(self.id, data_buffer.getvalue()) >= 0:
while self.response == None:
pass
return self.response
Expand Down Expand Up @@ -443,7 +443,7 @@ def setupServiceServerPublisher(self, data):
if srv.mres._md5sum == msg.md5sum:
self.callbacks[msg.topic_id] = srv.handlePacket
else:
raise Exception('Checksum does not match: ' + srv.res._md5sum + ',' + msg.md5sum)
raise Exception('Checksum does not match: ' + srv.mres._md5sum + ',' + msg.md5sum)
except Exception as e:
rospy.logerr("Creation of service server failed: %s", e)
def setupServiceServerSubscriber(self, data):
Expand All @@ -461,7 +461,7 @@ def setupServiceServerSubscriber(self, data):
if srv.mreq._md5sum == msg.md5sum:
srv.id = msg.topic_id
else:
raise Exception('Checksum does not match: ' + srv.req._md5sum + ',' + msg.md5sum)
raise Exception('Checksum does not match: ' + srv.mreq._md5sum + ',' + msg.md5sum)
except Exception as e:
rospy.logerr("Creation of service server failed: %s", e)

Expand All @@ -480,7 +480,7 @@ def setupServiceClientPublisher(self, data):
if srv.mreq._md5sum == msg.md5sum:
self.callbacks[msg.topic_id] = srv.handlePacket
else:
raise Exception('Checksum does not match: ' + srv.req._md5sum + ',' + msg.md5sum)
raise Exception('Checksum does not match: ' + srv.mreq._md5sum + ',' + msg.md5sum)
except Exception as e:
rospy.logerr("Creation of service client failed: %s", e)
def setupServiceClientSubscriber(self, data):
Expand All @@ -498,7 +498,7 @@ def setupServiceClientSubscriber(self, data):
if srv.mres._md5sum == msg.md5sum:
srv.id = msg.topic_id
else:
raise Exception('Checksum does not match: ' + srv.res._md5sum + ',' + msg.md5sum)
raise Exception('Checksum does not match: ' + srv.mres._md5sum + ',' + msg.md5sum)
except Exception as e:
rospy.logerr("Creation of service client failed: %s", e)

Expand Down

0 comments on commit 25e5a59

Please sign in to comment.