0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 20:33:53 +01:00

more error handling

This commit is contained in:
2025-12-28 17:09:38 +01:00
parent 8c7e233b13
commit 1b64cdf091
8 changed files with 55 additions and 48 deletions

View File

@@ -25,7 +25,7 @@ end
---@param oda_id integer
---@param data integer
function set_oda_id_data_rds2(oda_id, data)
if oda_id > #_RDS2_ODAs then return end
if oda_id < 1 or oda_id > #_RDS2_ODAs then error("Invalid ODA ID: " .. tostring(oda_id), 2) end
_RDS2_ODAs[oda_id].data = data
end
@@ -33,7 +33,7 @@ end
---@param oda_id integer
---@param func RDS2_ODAHandler
function set_oda_handler_rds2(oda_id, func)
if oda_id > #_RDS2_ODAs then return end
if oda_id < 1 or oda_id > #_RDS2_ODAs then error("Invalid ODA ID: " .. tostring(oda_id), 2) end
_RDS2_ODAs[oda_id].handler = func
end