from usr.EventMesh import eventMesh
from usr.httpota import httpota
+from usr.tcpserver import TcpServiceInit
# from usr.telecom_dmp import telecomDmpCb
# from usr.china_mobile_dmp import chinamobileCb
CAT1_SERVICE_HEAD = 'FE' #固定head
PROJECT_NAME = "Cat1SlipUDPService"
-PROJECT_VERSION = "PY_SRV_V21"
+PROJECT_VERSION = "PY_SRV_V22"
CONFIG_JSON="/usr/system_config.json"
CURRENT_APP_TYPE="pysrv"
# UDP_MSG_OTA
elif cmd == "1C":#
self.read_dev_ai_id()
+ elif cmd== "1D":
+ TcpService = TcpServiceInit()
+ TcpService.start_socket_thread()
elif cmd == "AC":#
if self.ack_sem==1:
self.ack_sem=0
self.conn= None
self.__sock_file = None
self.__sock_file = self.__socket_file_init()
- self.__thread_file = _thread.start_new_thread(self.__Socket_File_Thread, ())
- self.conn_thread=_thread.start_new_thread(self._client_conn_proc, ())
+
def __pack_tlv_format(self, head, content):
head1 = head
self.conn=cli_conn
clog.info('[serveice] accept a client: %s, %s' % (cli_ip_addr, cli_port))
except :
- utime.sleep_ms(2000)
+ utime.sleep_ms(2000)
def cat1FileTimerCb(self,*argc):
clog.info("timer test\r\n")
def otaTimeOut(self,*argc):
clog.info("重启成功!!!!!!!!\r\n")
+
+ def start_socket_thread(self):
+ __thread_file = _thread.start_new_thread(self.__Socket_File_Thread, ())
+ conn_thread=_thread.start_new_thread(self._client_conn_proc, ())
+
-TcpService = TcpServiceInit()
+# TcpService = TcpServiceInit()