repetition_queue = None
def send(self, event, msg):
- if self.timer_repetition_send == None:
- self.timer_repetition_send = osTimer()
- if self.repetition_queue == None:
- self.repetition_queue = Queue(100)
-
+ if EventMesh.platform != "gewu":
+ if self.timer_repetition_send == None:
+ self.timer_repetition_send = osTimer()
+ if self.repetition_queue == None:
+ self.repetition_queue = Queue(100)
+
send_data ="AL,"+msg
send_len = len(send_data)
# EventMesh.debug_log("AL_ProtoCol:send:{}".format(data))
# 通过socket发送到服务器端
EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data)
- self.repetition_queue.put(data)#发送入队
- self.timer_repetition_send.start(10000, 1, self.repetition_timer_cb)
+ if EventMesh.platform != "gewu":
+ self.repetition_queue.put(data)#发送入队
+ self.timer_repetition_send.start(10000, 1, self.repetition_timer_cb)
EventMesh.publish("set_dev_state",0)
def recv(self, event, msg):
"""
#EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.UD_SEND) #开始ud定位
# print("报警数据上报:recv:%s"%(msg))
EventMesh.debug_log("报警数据上报:recv:{}".format(msg))
- #
- if self.repetition_queue.empty() == False:
- self.repetition_queue.get()#出队
- else:
- self.timer_repetition_send.stop()
+ #
+ if EventMesh.platform != "gewu":
+ if self.repetition_queue.empty() == False:
+ self.repetition_queue.get()#出队
+ else:
+ self.timer_repetition_send.stop()
def repetition_timer_cb(self, *args, **kwargs):#每隔10秒发送一次
if self.repetition_queue.empty() == False: