add : USB CDC虚拟串口通讯

This commit is contained in:
2026-04-03 12:14:43 +08:00
parent da4e944bca
commit dc518cefed
59 changed files with 13943 additions and 673 deletions

View File

@@ -0,0 +1,121 @@
require "socket4G"
module(..., package.seeall)
socket.isReady = link.isReady
local tSocketModule = nil
local function init()
tSocketModule = tSocketModule or {
[link.CELLULAR] = socket4G,
[link.CH395] = socketCh395,
[link.W5500] = socketW5500,
[link.ESP8266] = socketESP8266
}
end
function tcp(ssl, cert, tCoreExtPara, ipv6)
init()
return tSocketModule[link.getNetwork()].tcp(ssl, cert, tCoreExtPara, ipv6)
end
function udp(ipv6)
init()
return tSocketModule[link.getNetwork()].udp(ipv6)
end
function setTcpResendPara(retryCnt, retryMaxTimeout)
init()
return tSocketModule[link.getNetwork()].setTcpResendPara(retryCnt, retryMaxTimeout)
end
function setDnsParsePara(retryCnt, retryTimeoutMulti)
init()
return tSocketModule[link.getNetwork()].setDnsParsePara(retryCnt, retryTimeoutMulti)
end
function printStatus()
init()
return tSocketModule[link.getNetwork()].printStatus()
end
function setLowPower(tm)
init()
return tSocketModule[link.getNetwork()].setLowPower(tm)
end
function setIpStatis(interval)
init()
return tSocketModule[link.getNetwork()].setIpStatis(interval or 0)
end