From ceae7ec6ce8dc796852fc73beb515219c600f03b Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Mon, 22 Dec 2025 21:46:50 +0100 Subject: [PATCH] oh --- plugin.lua | 4 ++-- src/command.lua | 4 ++-- src/lua_rds.c | 4 ++-- src/rds.c | 5 ----- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/plugin.lua b/plugin.lua index cbcf9f8..6f497a6 100644 --- a/plugin.lua +++ b/plugin.lua @@ -77,9 +77,9 @@ function set_rds_ptyn_enabled(enabled) end ---@return boolean function get_rds_ptyn_enabled() end ----@param rt_type boolean +---@param rt_type integer function set_rds_rt_type(rt_type) end ----@return boolean +---@return integer function get_rds_rt_type() end -- Modulation & Generation diff --git a/src/command.lua b/src/command.lua index 9e24af2..f2c9692 100644 --- a/src/command.lua +++ b/src/command.lua @@ -21,7 +21,7 @@ if type(data) == "string" and data ~= nil then elseif data == "rt1en" then return string.format("RT1EN=%s\r\n", string.format("%d", (get_rds_rt1_enabled() and 1 or 0))) elseif data == "rt2en" then return string.format("RT2EN=%s\r\n", string.format("%d", (get_rds_rt2_enabled() and 1 or 0))) elseif data == "ptynen" then return string.format("PTYNEN=%s\r\n", string.format("%d", (get_rds_ptyn_enabled() and 1 or 0))) - elseif data == "rttype" then return string.format("RTTYPE=%s\r\n", string.format("%d", (get_rds_rt_type() and 1 or 0))) + elseif data == "rttype" then return string.format("RTTYPE=%s\r\n", string.format("%d", get_rds_rt_type())) elseif data == "rds2mod" then return string.format("RDS2MOD=%s\r\n", string.format("%d", (get_rds_rds2mod() and 1 or 0))) elseif data == "rdsgen" then return string.format("RDSGEN=%s\r\n", string.format("%d",get_rds_rdsgen())) elseif data == "level" then return string.format("LEVEL=%s\r\n", string.format("%d", get_rds_level() * 255)) @@ -103,7 +103,7 @@ if type(data) == "string" and data ~= nil then elseif cmd == "rttype" then local type = tonumber(value) if not type then return "-" end - set_rds_rt_type(type ~= 0) + set_rds_rt_type(type) return "+" elseif cmd == "rds2mod" then local type = tonumber(value) diff --git a/src/lua_rds.c b/src/lua_rds.c index f079a49..87b1502 100644 --- a/src/lua_rds.c +++ b/src/lua_rds.c @@ -92,8 +92,8 @@ BOOL_GETTER(rt2_enabled) BOOL_SETTER(ptyn_enabled) BOOL_GETTER(ptyn_enabled) -BOOL_SETTER(rt_type) -BOOL_GETTER(rt_type) +INT_SETTER(rt_type) +INT_GETTER(rt_type) int lua_set_rds_rds2mod(lua_State *localL) { if (!lua_isboolean(localL, 1)) return luaL_error(localL, "boolean expected, got %s", luaL_typename(localL, 1)); diff --git a/src/rds.c b/src/rds.c index 3e18436..85630ed 100644 --- a/src/rds.c +++ b/src/rds.c @@ -679,9 +679,6 @@ void set_rds_defaults(RDSEncoder* enc, uint8_t program) { memset(&(enc->rtpData[program]), 0, sizeof(RDSRTPlusData)*2); memset(&(enc->encoder_data), 0, sizeof(RDSEncoderData)); - enc->encoder_data.encoder_addr[0] = 255; - enc->encoder_data.encoder_addr[1] = 255; - enc->data[program].ct = 1; strcpy((char *)enc->data[program].grp_sqc, DEFAULT_GRPSQC); enc->data[program].tp = 1; @@ -694,8 +691,6 @@ void set_rds_defaults(RDSEncoder* enc, uint8_t program) { enc->data[program].rt_type = 2; reset_rds_state(enc, program); - - enc->encoder_data.ascii_data.expected_encoder_addr = 255; // Unknown } void init_rds_encoder(RDSEncoder* enc) {