1
0
mirror of https://github.com/DigitalDevices/octonet.git synced 2023-10-10 11:36:52 +00:00

channelscan: doscan (WIP)

NIT scan added, adapted to revised octoscan cli interface

Manual usage:
	/var/channels/doscan.lua <key>
This commit is contained in:
mvoelkel 2016-01-09 19:57:54 +01:00
parent edffd6e172
commit 175f58aaa5

View File

@ -67,19 +67,39 @@ if tl.SourceList then
for _,Source in ipairs(tl.SourceList) do
print(Source.Title)
if key == Source.Key then
local req = ""
if Source.DVBType == "S" then
req = 'src=1&'
local SourceOptions = ""
if Source.UseNIT then
SourceOptions = SourceOptions.."--use_nit "
end
if Source.DVBType == "S" then
SourceOptions = '--src=1'
end
for _,Transponder in ipairs(Source.TransponderList) do
Count = Count + 1
if Count > Max then
break
end
local Params = ""
local p,v
for p,v in Transponder.Request:gmatch("(%a+)=([%w%.]+)") do
if p == "freq" then
Params = Params .. " --freq="..v
elseif p == "pol" then
Params = Params .. " --pol="..v
elseif p == "msys" then
Params = Params .. " --msys="..v
elseif p == "sr" then
Params = Params .. " --sr="..v
elseif p == "mtype" then
Params = Params .. " --mtype="..v
end
end
print("--------------------------------------------------------------")
print(Transponder.Request)
local octoscan = io.popen('octoscan '..ipAddr..' "'..req..Transponder.Request..'"',"r")
print('octoscan '..SourceOptions..Params..' '..ipAddr)
local octoscan = io.popen('octoscan '..SourceOptions..' '..Params..' '..ipAddr,"r")
if octoscan then
while true do
local line = octoscan:read("*l")
@ -101,7 +121,7 @@ if tl.SourceList then
end
print(line)
if line == "END" then
local channel = { Title=sname, Service=sid, Request = req..Transponder.Request.."&pids=0,"..pids, Tracks=tracks }
local channel = { Title=sname, Service=sid, Request = Request.."&pids=0,"..pids, Tracks=tracks }
local cname = pname
if isradio then
cname = "Radio - "..pname
@ -132,6 +152,8 @@ if tl.SourceList then
end
end
end
elseif line:sub(1,5) == "TUNE:" then
Request = line:sub(6)
end
end
octoscan:close()