update 通信方式
This commit is contained in:
@ -39,13 +39,11 @@ class RobotClient(TCPClient):
|
||||
|
||||
def send_Status(self):
|
||||
request = DATARequest()
|
||||
|
||||
attributes = dir(DataAddress())
|
||||
dataAddr = DataAddress()
|
||||
request.queryAddr.append(dataAddr)
|
||||
|
||||
# 移除特殊属性和方法
|
||||
attributes = [attr for attr in attributes if not attr.startswith('__')]
|
||||
request.queryAddr= attributes
|
||||
request_status_json = vars(request)
|
||||
request_status_json = request.toString()
|
||||
# 转字符串
|
||||
while True:
|
||||
try:
|
||||
|
||||
@ -31,7 +31,7 @@ class TCPClient:
|
||||
self.connected = self.error_count > 0
|
||||
try:
|
||||
#time.sleep(30)
|
||||
if (self.send_Command() and self.send_Status()):
|
||||
if (self.send_Status() and self.send_Command()):
|
||||
self.error_count = 0
|
||||
except:
|
||||
self.error_count += 1
|
||||
|
||||
Reference in New Issue
Block a user