@@ -89,7 +89,7 @@ def __socket_reponse(self):
8989 return RET_CODE .RET_RESPONSE_ERROR_CODE
9090 return RET_CODE .RET_SUCCESS_CODE
9191
92- # station模式
92+ # station模式
9393 def station (self , user , password ):
9494 self .clear_remain ()
9595 __head = 'F3'
@@ -102,7 +102,7 @@ def station(self, user, password):
102102 self .__Socket_UDP (__head , self .__message )
103103 return self .__socket_reponse ()
104104
105- #ap 模式
105+ #ap 模式
106106 def ap (self , user , password ):
107107 self .clear_remain ()
108108 __head = 'F2'
@@ -116,7 +116,7 @@ def ap(self, user, password):
116116 self .__Socket_UDP (__head , self .__message )
117117 return self .__socket_reponse ()
118118
119- # web配网模式
119+ # web配网模式
120120 def web_config (self , user , password ):
121121 self .clear_remain ()
122122 __head = 'F0'
@@ -135,7 +135,7 @@ def clear_remain(self):
135135 self .__err = 0
136136 self .__value = None
137137
138- # 查询网卡状态
138+ # 查询网卡状态
139139 def status (self ):
140140 self .clear_remain ()
141141 self .__Socket_UDP ('F1' , '0' )
@@ -167,7 +167,7 @@ def smartconfig(self, mode):
167167 self .__Socket_UDP (__head , self .__message )
168168 return self .__socket_reponse ()
169169
170- # 配置查询
170+ # 配置查询
171171 def config (self , param ):
172172 self .clear_remain ()
173173 __head = 'F7'
@@ -177,13 +177,13 @@ def config(self, param):
177177 return RET_CODE .RET_TIMEOUT_CODE
178178 return self .__value [2 ]
179179
180- #添加路由信息
180+ #添加路由信息
181181 def router_add (self , ip = '192.168.4.1' , mask = '255.255.255.0' ):
182182 self .ip = ip
183183 self .mask = mask
184184 return slip .router_add ('192.168.4.1' , '255.255.255.0' )
185185
186- # 获取slip的网络配置
186+ # 获取slip的网络配置
187187 def ipconfig (self ):
188188 return slip .ipconfig ()
189189
@@ -204,14 +204,14 @@ def set_default_NIC(self, ip_str):
204204 return RET_CODE .RET_SUCCESS_CODE
205205 return RET_CODE .RET_PARAM_ERROR_CODE
206206
207- # 释放slip网卡
207+ # 释放slip网卡
208208 def stop (self ):
209209 _thread .stop_thread (self .__threadid )
210210 slip .destroy ()
211211 self .__sock .close ()#释放socket
212212 return RET_CODE .RET_SUCCESS_CODE
213213
214- # 封装tlv数据包
214+ # 封装tlv数据包
215215 def __pack_tlv_format (self , head , content ):
216216 self .head = head
217217 self .content = content
@@ -221,7 +221,7 @@ def __pack_tlv_format(self, head, content):
221221 tlv_pack = self .head + len_str + self .content
222222 return tlv_pack
223223
224- # 解码tlv数据包
224+ # 解码tlv数据包
225225 def __unpack_tlv_format (self , msg ):
226226 self .msg = str (msg )
227227 tag = self .msg [0 :2 ]
@@ -233,8 +233,7 @@ def __unpack_tlv_format(self, msg):
233233 unpack = (tag ,length ,value )
234234 return unpack
235235
236-
237- # socket通信(UDP)模块
236+ # socket通信(UDP)模块
238237 def __Socket_UDP (self , head , content ):
239238 self .head = head
240239 self .content = content
@@ -252,9 +251,11 @@ def __Socket_UDP(self, head, content):
252251 data = self .__queue .get ()
253252 self .__wait_resp = 0
254253 return data
254+
255255 def __def__ (self ):
256256 self .stop ()
257- # socket通信(UDP)模块
257+
258+ # socket通信(UDP)模块
258259 def __Socket_Thread (self ):
259260 while True :
260261 try :
0 commit comments