2021-05-06 10:21:10 +00:00
|
|
|
/***************************************************************************
|
2025-04-04 17:06:57 +00:00
|
|
|
* Copyright (C) 2021 - 2025 by Federico Amedeo Izzo IU2NUO, *
|
2023-02-08 15:33:02 +00:00
|
|
|
* Niccolò Izzo IU2KIN *
|
|
|
|
* Frederik Saraci IU2NRO *
|
|
|
|
* Silvano Seva IU2KWO *
|
2021-05-06 10:21:10 +00:00
|
|
|
* *
|
|
|
|
* 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 <http://www.gnu.org/licenses/> *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2022-06-09 21:11:01 +00:00
|
|
|
#include <emulator/emulator.h>
|
2021-05-06 10:21:10 +00:00
|
|
|
#include <interfaces/radio.h>
|
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
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(" ");
|
2021-11-08 12:50:36 +00:00
|
|
|
if(mode == OPMODE_NONE) mStr = "NONE";
|
|
|
|
if(mode == OPMODE_FM) mStr = "FM";
|
|
|
|
if(mode == OPMODE_DMR) mStr = "DMR";
|
|
|
|
if(mode == OPMODE_M17) mStr = "M17";
|
2021-05-06 10:21:10 +00:00
|
|
|
|
|
|
|
printf("radio_linux: setting opmode to %s\n", mStr.c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool radio_checkRxDigitalSquelch()
|
|
|
|
{
|
2021-06-03 12:59:59 +00:00
|
|
|
// puts("radio_linux: radio_checkRxDigitalSquelch(), returning 'false'");
|
|
|
|
return false;
|
2021-05-06 10:21:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
|
2023-12-28 23:27:33 +00:00
|
|
|
rssi_t radio_getRssi()
|
2021-05-06 10:21:10 +00:00
|
|
|
{
|
|
|
|
// Commented to reduce verbosity on Linux
|
|
|
|
// printf("radio_linux: requested RSSI at freq %d, returning -100dBm\n", rxFreq);
|
2023-12-28 23:27:33 +00:00
|
|
|
return static_cast< rssi_t >(emulator_state.RSSI);
|
2021-05-06 10:21:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum opstatus radio_getStatus()
|
|
|
|
{
|
|
|
|
return OFF;
|
|
|
|
}
|