|
@@ -80,6 +80,7 @@ class ExportIO(threading.Thread):
|
|
|
self._user_leave_callback(self._id)
|
|
|
self._open_door_flag = False
|
|
|
self._retry_count = self._retry_count + 1
|
|
|
+ print(" _retry_count = %d"%self._retry_count)
|
|
|
else:#else 无限等待,什么也不做, 等待汽车离开
|
|
|
self._retry_count = 0
|
|
|
|
|
@@ -102,15 +103,15 @@ class ExportIO(threading.Thread):
|
|
|
print("Connected to {}:{}".format(self._ip, self._port))
|
|
|
return reader, writer
|
|
|
async def recv_loop(self):
|
|
|
- if (self._id == 5):
|
|
|
- print(" test 1 ")
|
|
|
+ # if (self._id == 5):
|
|
|
+ # print(" test 1 ")
|
|
|
while self._close==False:
|
|
|
- if (self._id == 5):
|
|
|
- print(" test 2 ")
|
|
|
+ # if (self._id == 5):
|
|
|
+ # print(" test 2 ")
|
|
|
try:
|
|
|
recieve=await self._reader.readuntil(b'$')
|
|
|
- if (self._id == 5):
|
|
|
- print(" 00 recieve = " + str(recieve))
|
|
|
+ # if (self._id == 5):
|
|
|
+ # print(" 00 recieve = " + str(recieve))
|
|
|
except Exception as e:
|
|
|
print("self._reader.readuntil(b'$') error")
|
|
|
print(" e: {}".format(e))
|
|
@@ -130,8 +131,8 @@ class ExportIO(threading.Thread):
|
|
|
print("self._latest_iomsg error")
|
|
|
continue
|
|
|
else:
|
|
|
- if (self._id == 5):
|
|
|
- print(" 11 recieve = " + str(recieve))
|
|
|
+ # if (self._id == 5):
|
|
|
+ # print(" 11 recieve = " + str(recieve))
|
|
|
ex_name = "statu_ex"
|
|
|
key = "out_mcpu_%d_statu_port" % self._id
|
|
|
self._rabbit_mq.publish(ex_name, key, tf.MessageToString(self._latest_iomsg, as_utf8=True))
|