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

won't work (100%)

This commit is contained in:
2025-03-14 22:10:56 +01:00
parent 0dee049746
commit 211ed65c50
11 changed files with 458 additions and 673 deletions

View File

@@ -1,6 +1,8 @@
#include "common.h"
#include "ascii_cmd.h"
#include "control_pipe.h"
#include "rds.h"
#include "modulator.h"
static int fd;
static struct pollfd poller;
@@ -22,7 +24,7 @@ int open_control_pipe(char *filename) {
* Polls the control file (pipe), and if a command is received,
* calls process_ascii_cmd.
*/
void poll_control_pipe() {
void poll_control_pipe(RDSModulator* enc) {
static unsigned char pipe_buf[CTL_BUFFER_SIZE];
static unsigned char cmd_buf[CMD_BUFFER_SIZE];
int bytes_read;
@@ -45,7 +47,7 @@ void poll_control_pipe() {
if (cmd_len > 0 && cmd_len < CMD_BUFFER_SIZE) {
memset(cmd_buf, 0, CMD_BUFFER_SIZE);
strncpy((char *)cmd_buf, token, CMD_BUFFER_SIZE - 1);
process_ascii_cmd(cmd_buf);
process_ascii_cmd(enc, cmd_buf);
}
token = strtok(NULL, "\n");
}