欢迎您! 我来自波兰。 我在AliExpress买了Air202。
我有这样的剧本。
Hello! I'm from Poland. I bought Air202 on AliExpress.
I have a script like that.
require"ril"
module(...,package.seeall)
local function print(...)
_G.print("test",...)
end
-----------------------------------------------------------------------------------------
local function ats()
ril.request("ATS7?")
end
sys.timer_start(ats,20000)
-----------------------------------------------------------------------------------------
ril.regrsp("ATS7?",fnc,2)
-----------------------------------------------------------------------------------------
local function fnc(data,prefix)
if data == "ATS7?" then
print(data)
end
end
ril.regurc("ATS7?",fnc)
-----------------------------------------------------------------------------------------
如何阅读ATS7的答案? 并打印21?
谢谢你的帮助。
How to read the answer from ATS7? and print 21?
Thank you for your help.
谢谢你的回答,但它不起作用。
这是我的第二个脚本:
Thank you for your answer, but it does not work.
This is my second script:
require"ril"
module(...,package.seeall)
local function print(...)
_G.print("test",...)
end
-----------------------------------------------------------------------------------------
local function ats()
ril.request("ATS7?")
end
sys.timer_start(ats,20000)
-----------------------------------------------------------------------------------------
ril.regrsp('S', nil, 1) -- set ATS response format numberic
ril.request("ATS7?", nil, function(cmd, success, response, intermediate) -- response callback
log.info('req ATS7', success, response, intermediate)
end)
在这里你可以看到错误:
Here you can see the error: