0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-27 04:43:52 +01:00

af is in lua now

This commit is contained in:
2025-12-22 21:34:07 +01:00
parent f26f01e05a
commit 0848d52f88
4 changed files with 92 additions and 49 deletions

View File

@@ -207,6 +207,42 @@ if type(data) == "string" and data ~= nil then
set_rds_rtp_meta(is_ertp, enabled, running)
if f2 ~= 0 then toggle_rds_rtp(is_ertp) end
return "+"
elseif cmd == "af" then
local af_table = {}
if value == "" or value == "0" then
set_rds_af_group0({})
return "+"
end
for freq_str in value:gmatch("([^,]+)") do
local f = tonumber(freq_str)
if f then table.insert(af_table, f)
else return "-" end
end
if #af_table > 25 then return "-" end
set_rds_af_group0(af_table)
return "+"
elseif cmd == "afo" then
local af_table = {}
if value == "" or value == "0" then
set_rds_af_oda({})
return "+"
end
for freq_str in value:gmatch("([^,]+)") do
local f = tonumber(freq_str)
if f then table.insert(af_table, f)
else return "-" end
end
if #af_table > 25 then return "-" end
set_rds_af_oda(af_table)
return "+"
else
return "?"
end