Skip to content

Commit 17648dd

Browse files
committed
fix bug
1 parent 18272ac commit 17648dd

File tree

11 files changed

+24
-0
lines changed

11 files changed

+24
-0
lines changed

pymycobot/mecharmsocket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ def _mesg(self, genre, *args, **kwargs):
8787
if genre == ProtocolCode.SET_SSID_PWD:
8888
return None
8989
res = self._process_received(data, genre)
90+
if res == []:
91+
return None
9092
if genre in [
9193
ProtocolCode.ROBOT_VERSION,
9294
ProtocolCode.IS_POWER_ON,

pymycobot/mercury.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def _mesg(self, genre, *args, **kwargs):
5050
if genre == ProtocolCode.SET_SSID_PWD:
5151
return None
5252
res = self._process_received(data, genre, 14)
53+
if res == []:
54+
return None
5355
if genre in [
5456
ProtocolCode.ROBOT_VERSION,
5557
ProtocolCode.GET_ROBOT_ID,

pymycobot/myarm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ def _mesg(self, genre, *args, **kwargs):
8686
if has_reply:
8787
data = self._read(genre, command=command)
8888
res = self._process_received(data, genre, arm=7)
89+
if res == []:
90+
return None
8991
if genre in [
9092
ProtocolCode.ROBOT_VERSION,
9193
ProtocolCode.GET_ROBOT_ID,

pymycobot/myarmsocket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ def _mesg(self, genre, *args, **kwargs):
8787
if genre == ProtocolCode.SET_SSID_PWD:
8888
return None
8989
res = self._process_received(data, genre)
90+
if res == []:
91+
return None
9092
if genre in [
9193
ProtocolCode.ROBOT_VERSION,
9294
ProtocolCode.IS_POWER_ON,

pymycobot/mybuddy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def _mesg(self, genre, *args, **kwargs):
136136
if has_reply:
137137
data = self._read()
138138
res = self._process_received(data, genre, arm=12)
139+
if res == []:
140+
return None
139141
if genre in [
140142
ProtocolCode.ROBOT_VERSION,
141143
ProtocolCode.SOFTWARE_VERSION,

pymycobot/mybuddybluetooth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def _mesg(self, genre, *args, **kwargs):
5454

5555
if data:
5656
res = self._process_received(data, genre, arm=12)
57+
if res == []:
58+
return None
5759
if genre in [
5860
ProtocolCode.ROBOT_VERSION,
5961
ProtocolCode.SOFTWARE_VERSION,

pymycobot/mybuddysocket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def _mesg(self, genre, *args, **kwargs):
9797
if has_reply:
9898
data = self._read(genre, 'socket')
9999
res = self._process_received(data, genre, arm=12)
100+
if res == []:
101+
return None
100102
if genre in [
101103
ProtocolCode.ROBOT_VERSION,
102104
ProtocolCode.IS_POWER_ON,

pymycobot/mycobot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ def _res(self, real_command, has_reply, genre):
9999
if genre == ProtocolCode.SET_SSID_PWD:
100100
return None
101101
res = self._process_received(data, genre)
102+
if res == []:
103+
return None
104+
if res == []:
105+
return None
102106
if genre in [
103107
ProtocolCode.ROBOT_VERSION,
104108
ProtocolCode.GET_ROBOT_ID,

pymycobot/mycobotsocket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ def _mesg(self, genre, *args, **kwargs):
8888
if genre == ProtocolCode.SET_SSID_PWD:
8989
return None
9090
res = self._process_received(data, genre)
91+
if res == []:
92+
return None
9193
if genre in [
9294
ProtocolCode.ROBOT_VERSION,
9395
ProtocolCode.IS_POWER_ON,

pymycobot/mypalletizer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def _mesg(self, genre, *args, **kwargs):
125125
data = self._read(genre)
126126
# print(data)
127127
res = self._process_received(data, genre)
128+
if res == []:
129+
return None
128130
if genre in [
129131
ProtocolCode.ROBOT_VERSION,
130132
ProtocolCode.SOFTWARE_VERSION,

0 commit comments

Comments
 (0)