From e7b48b14a5bd2ee60d45c6a2417f8ec2a41d6878 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Thu, 6 May 2021 12:21:10 +0200 Subject: [PATCH] Updated radio driver stub for linux platform --- meson.build | 2 +- platform/drivers/baseband/radio_linux.cpp | 83 +++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 platform/drivers/baseband/radio_linux.cpp diff --git a/meson.build b/meson.build index e8affd31..cff39171 100644 --- a/meson.build +++ b/meson.build @@ -192,7 +192,7 @@ linux_src = src + ['platform/targets/linux/emulator/emulator.c', 'platform/mcu/x86_64/drivers/gpio.c', 'platform/mcu/x86_64/drivers/delays.c', 'platform/mcu/x86_64/drivers/rtc.c', - 'platform/drivers/baseband/radio_linux.c', + 'platform/drivers/baseband/radio_linux.cpp', 'platform/drivers/audio/audio_linux.c', 'platform/targets/linux/platform.c'] diff --git a/platform/drivers/baseband/radio_linux.cpp b/platform/drivers/baseband/radio_linux.cpp new file mode 100644 index 00000000..aeb001e6 --- /dev/null +++ b/platform/drivers/baseband/radio_linux.cpp @@ -0,0 +1,83 @@ +/*************************************************************************** + * Copyright (C) 2021 by Federico Amedeo Izzo IU2NUO, * + * Niccolò Izzo IU2KIN * + * Frederik Saraci IU2NRO * + * Silvano Seva IU2KWO * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see * + ***************************************************************************/ + +#include +#include +#include + +void radio_init(const rtxStatus_t *rtxState) +{ + (void) rtxState; + puts("radio_linux: init() called"); +} + +void radio_terminate() +{ + puts("radio_linux: terminate() called"); +} + +void radio_setOpmode(const enum opmode mode) +{ + std::string mStr(" "); + if(mode == NONE) mStr = "NONE"; + if(mode == FM) mStr = "FM"; + if(mode == DMR) mStr = "DMR"; + if(mode == M17) mStr = "M17"; + + printf("radio_linux: setting opmode to %s\n", mStr.c_str()); +} + +bool radio_checkRxDigitalSquelch() +{ + puts("radio_linux: radio_checkRxDigitalSquelch(), returning 'true'"); + return true; +} + +void radio_enableRx() +{ + puts("radio_linux: enableRx() called"); +} + +void radio_enableTx() +{ + puts("radio_linux: enableTx() called"); +} + +void radio_disableRtx() +{ + puts("radio_linux: disableRtx() called"); +} + +void radio_updateConfiguration() +{ + puts("radio_linux: updateConfiguration() called"); +} + +float radio_getRssi() +{ + // Commented to reduce verbosity on Linux + // printf("radio_linux: requested RSSI at freq %d, returning -100dBm\n", rxFreq); + return -100.0f; +} + +enum opstatus radio_getStatus() +{ + return OFF; +}