0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 12:32:05 +01:00

more documentation and allow bigger files for rds2

This commit is contained in:
2025-12-31 19:50:27 +01:00
parent a71a565d06
commit 93daa223f3
2 changed files with 7 additions and 7 deletions

View File

@@ -64,7 +64,7 @@ function rds2_group(stream)
if checked == #_RDS2_ODAs then return false, 0, 0, 0, 0 end
local oda = _RDS2_ODAs[_RDS2_ODA_pointer]
local channel_offset = 16 * ((not oda.file_related) and 1 or 0)
local channel_offset = 16 * ((not oda.file_related) and 1 or 0) -- Channels 0-15 are reserved for file related things
local channel = ((_RDS2_ODA_pointer - 1 + channel_offset) & 0x3F)
if oda.file_related then channel = channel & 0xF end
@@ -110,11 +110,11 @@ function rds2_group(stream)
local channel_bitshift = 8
local fid = (a & 0xC000) >> 14
local fn_msb = (a >> 13) & 1
if fid == 0 and fn_msb == 0 then
warn("RDS2 ODA is tunneling (A or B) over C")
return true, 0, b, c, d -- Tunnel, not sure why but sure
--FID = 1 means a normal ODA group
--FID = 2 means a RFT file
if fid == 0 and fn_msb == 0 then return true, 0, b, c, d -- Tunnel, not sure why but sure
-- FID == 0 and FN_MSB = 1 means RFT data, file data
-- FID == 1 is the standard ODA group
-- FID == 2 is AID
-- FID == 3 is reserved
elseif fid == 2 and fn_msb == 0 then channel_bitshift = 0 end -- This is AID
return generated, (channel << channel_bitshift) | a, b, c, d
end

View File

@@ -158,7 +158,7 @@ function RftInstance:sendFile(aid, path, id, crc, once)
end
end
if f_size > 262143 then error("File too large") end
if f_size > (0x3ffff * 5) then error("File too large") end
if self.oda_id == nil then self:start() end
set_oda_id_data_rds2(self.oda_id, f_size | (id & 63) << 18 | (self.version & 7) << 24 | (self.crc_enabled and 1 or 0) << 27)