Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions network-comm/nic/wifi/WLAN.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ************************************************************** #
# ********************************************************************************************************************** #
# WHEN WHO WHAT, WHERE, WHY
# ---------- ----------- -------------------------- #
# ********************************************************************************************************************** #
# 23/01/2024 Francis Add timeout handling
# ************************************************************** #
# ---------- ----------- ---------------------------------------------------------------------------------- #
# 06/08/2025 Sirius Fix port occupation issue by adding socket release in stop function, retaining del
# ********************************************************************************************************************* #

import usocket
import log
Expand Down Expand Up @@ -206,6 +208,7 @@ def set_default_NIC(self, ip_str):
def stop(self):
_thread.stop_thread(self.__threadid)
slip.destroy()
self.__sock.close()#释放socket
return RET_CODE.RET_SUCCESS_CODE

# 封装tlv数据包
Expand All @@ -229,6 +232,7 @@ def __unpack_tlv_format(self, msg):
return RET_CODE.RET_RESPONSE_ERROR_CODE
unpack = (tag,length,value)
return unpack


# socket通信(UDP)模块
def __Socket_UDP(self, head, content):
Expand All @@ -248,7 +252,8 @@ def __Socket_UDP(self, head, content):
data = self.__queue.get()
self.__wait_resp = 0
return data

def __def__(self):
self.stop()
# socket通信(UDP)模块
def __Socket_Thread(self):
while True:
Expand Down