mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-26 20:33:53 +01:00
oh
This commit is contained in:
@@ -77,9 +77,9 @@ function set_rds_ptyn_enabled(enabled) end
|
|||||||
---@return boolean
|
---@return boolean
|
||||||
function get_rds_ptyn_enabled() end
|
function get_rds_ptyn_enabled() end
|
||||||
|
|
||||||
---@param rt_type boolean
|
---@param rt_type integer
|
||||||
function set_rds_rt_type(rt_type) end
|
function set_rds_rt_type(rt_type) end
|
||||||
---@return boolean
|
---@return integer
|
||||||
function get_rds_rt_type() end
|
function get_rds_rt_type() end
|
||||||
|
|
||||||
-- Modulation & Generation
|
-- Modulation & Generation
|
||||||
|
|||||||
@@ -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 == "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 == "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 == "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 == "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 == "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))
|
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
|
elseif cmd == "rttype" then
|
||||||
local type = tonumber(value)
|
local type = tonumber(value)
|
||||||
if not type then return "-" end
|
if not type then return "-" end
|
||||||
set_rds_rt_type(type ~= 0)
|
set_rds_rt_type(type)
|
||||||
return "+"
|
return "+"
|
||||||
elseif cmd == "rds2mod" then
|
elseif cmd == "rds2mod" then
|
||||||
local type = tonumber(value)
|
local type = tonumber(value)
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ BOOL_GETTER(rt2_enabled)
|
|||||||
BOOL_SETTER(ptyn_enabled)
|
BOOL_SETTER(ptyn_enabled)
|
||||||
BOOL_GETTER(ptyn_enabled)
|
BOOL_GETTER(ptyn_enabled)
|
||||||
|
|
||||||
BOOL_SETTER(rt_type)
|
INT_SETTER(rt_type)
|
||||||
BOOL_GETTER(rt_type)
|
INT_GETTER(rt_type)
|
||||||
|
|
||||||
int lua_set_rds_rds2mod(lua_State *localL) {
|
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));
|
if (!lua_isboolean(localL, 1)) return luaL_error(localL, "boolean expected, got %s", luaL_typename(localL, 1));
|
||||||
|
|||||||
@@ -679,9 +679,6 @@ void set_rds_defaults(RDSEncoder* enc, uint8_t program) {
|
|||||||
memset(&(enc->rtpData[program]), 0, sizeof(RDSRTPlusData)*2);
|
memset(&(enc->rtpData[program]), 0, sizeof(RDSRTPlusData)*2);
|
||||||
memset(&(enc->encoder_data), 0, sizeof(RDSEncoderData));
|
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;
|
enc->data[program].ct = 1;
|
||||||
strcpy((char *)enc->data[program].grp_sqc, DEFAULT_GRPSQC);
|
strcpy((char *)enc->data[program].grp_sqc, DEFAULT_GRPSQC);
|
||||||
enc->data[program].tp = 1;
|
enc->data[program].tp = 1;
|
||||||
@@ -694,8 +691,6 @@ void set_rds_defaults(RDSEncoder* enc, uint8_t program) {
|
|||||||
enc->data[program].rt_type = 2;
|
enc->data[program].rt_type = 2;
|
||||||
|
|
||||||
reset_rds_state(enc, program);
|
reset_rds_state(enc, program);
|
||||||
|
|
||||||
enc->encoder_data.ascii_data.expected_encoder_addr = 255; // Unknown
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_rds_encoder(RDSEncoder* enc) {
|
void init_rds_encoder(RDSEncoder* enc) {
|
||||||
|
|||||||
Reference in New Issue
Block a user