Compare commits
17 Commits
master
...
multiple_c
| Author | SHA1 | Date |
|---|---|---|
|
|
c6d273c53d | |
|
|
5e537d3607 | |
|
|
fae410f872 | |
|
|
c9e05dbe96 | |
|
|
f2009fa301 | |
|
|
363acd70f8 | |
|
|
0c43cc018f | |
|
|
677496cde5 | |
|
|
27b1b3c2a2 | |
|
|
536fd8d5e1 | |
|
|
d5cf330e35 | |
|
|
a76fba7310 | |
|
|
4da3c05502 | |
|
|
2dd4291137 | |
|
|
11c4aa064a | |
|
|
2aac7444b8 | |
|
|
25429fd160 |
|
|
@ -252,6 +252,14 @@ sounds and roger beeps will not have tone sent with them though.
|
|||
will always transmit a CTCSS tone as soon as the transmitter is turned on.
|
||||
.RE
|
||||
.TP
|
||||
.B TX_CTCSS_ON_RX
|
||||
Define a comma sperated list of float values as tone frequencies here. The
|
||||
values will be mapped to the according Rx. That means if Rx1 is receiving a
|
||||
signal the first ctcss tone will be send, if the second Rx is receiving the
|
||||
second ctcss tone will be send and so on.
|
||||
Example:
|
||||
TX_CTCSS_ON_RX=67.9,123.0,250.3
|
||||
.TP
|
||||
.B MACROS
|
||||
Point out a section that contains the macros that should be used by this logic
|
||||
core. See the section description for macros below for more information.
|
||||
|
|
|
|||
|
|
@ -249,7 +249,10 @@ class TxAdapter : public Tx, public AudioSource
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
virtual void setTxCtcss(float fq) {}
|
||||
|
||||
|
||||
int writeSamples(const float *samples, int count)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -556,6 +556,13 @@ void NetUplink::handleMsg(Msg *msg)
|
|||
break;
|
||||
}
|
||||
|
||||
case MsgSendCtcss::TYPE:
|
||||
{
|
||||
MsgSendCtcss *ctcss_msg = reinterpret_cast<MsgSendCtcss *>(msg);
|
||||
tx->setTxCtcss(ctcss_msg->Fq());
|
||||
break;
|
||||
}
|
||||
|
||||
case MsgRxAudioCodecSelect::TYPE:
|
||||
{
|
||||
MsgRxAudioCodecSelect *codec_msg =
|
||||
|
|
|
|||
|
|
@ -327,6 +327,31 @@ bool Logic::initialize(void)
|
|||
cout << "Sel5 macro range from " << sel5_from << " to " << sel5_to << endl;
|
||||
}
|
||||
|
||||
if (cfg().getValue(name(), "TX_CTCSS_ON_RX", value))
|
||||
{
|
||||
cout << "ATTENTION: This version is supporting an additional NetTrxMsg-command "
|
||||
<< "to control the ctcss-tone on the tx. So a problem with the "
|
||||
<< "recent version of SvxServer may occur.\n";
|
||||
string::iterator comma;
|
||||
int cnt = 1;
|
||||
string::iterator begin = value.begin();
|
||||
do
|
||||
{
|
||||
comma = find(begin, value.end(), ',');
|
||||
if (comma == value.end())
|
||||
{
|
||||
tx_ctcss_rx.insert(std::pair<int,float>(cnt, atof(string(begin, value.end()).c_str() ) ));
|
||||
}
|
||||
else
|
||||
{
|
||||
tx_ctcss_rx.insert(std::pair<int, float>(cnt, atof(string(begin, comma).c_str() ) ));
|
||||
begin = comma + 1;
|
||||
cnt++;
|
||||
}
|
||||
} while (comma != value.end());
|
||||
cout << "TX_CTCSS_ON_RX\n";
|
||||
}
|
||||
|
||||
if (cfg().getValue(name(), "TX_CTCSS", value))
|
||||
{
|
||||
string::iterator comma;
|
||||
|
|
@ -964,6 +989,11 @@ void Logic::squelchOpen(bool is_open)
|
|||
LocationInfo::instance()->setReceiving(name(), tv, is_open);
|
||||
}
|
||||
|
||||
std::map<int,float>::iterator it = tx_ctcss_rx.find(rx().sqlRxId());
|
||||
if (it != tx_ctcss_rx.end())
|
||||
{
|
||||
tx().setTxCtcss((*it).second);
|
||||
}
|
||||
updateTxCtcss(is_open, TX_CTCSS_SQL_OPEN);
|
||||
|
||||
checkIdle();
|
||||
|
|
|
|||
|
|
@ -290,6 +290,8 @@ class Logic : public sigc::trackable
|
|||
DtmfDigitHandler *dtmf_digit_handler;
|
||||
Async::Pty *state_pty;
|
||||
Async::Pty *dtmf_ctrl_pty;
|
||||
std::map<int, float> tx_ctcss_rx;
|
||||
|
||||
|
||||
void loadModules(void);
|
||||
void loadModule(const std::string& module_name);
|
||||
|
|
|
|||
|
|
@ -600,6 +600,12 @@ void LocalTx::setTransmittedSignalStrength(float siglev)
|
|||
} /* LocalTx::setTransmittedSignalLevel */
|
||||
|
||||
|
||||
void LocalTx::setTxCtcss(float fq)
|
||||
{
|
||||
cout << "sending tone " << fq << endl;
|
||||
sine_gen->setFq(fq);
|
||||
} /* LocalTx::setTxCtcss */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
|
|
|
|||
|
|
@ -188,6 +188,12 @@ class LocalTx : public Tx
|
|||
*/
|
||||
void setTransmittedSignalStrength(float siglev);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void setTxCtcss(float fq);
|
||||
|
||||
|
||||
private:
|
||||
std::string name;
|
||||
Async::Config &cfg;
|
||||
|
|
|
|||
|
|
@ -240,6 +240,16 @@ void MultiTx::setTransmittedSignalStrength(float siglev)
|
|||
} /* MultiTx::setTransmittedSignalStrength */
|
||||
|
||||
|
||||
void MultiTx::setTxCtcss(float fq)
|
||||
{
|
||||
list<Tx *>::iterator it;
|
||||
for (it=txs.begin(); it!=txs.end(); ++it)
|
||||
{
|
||||
cout << "sending tone " << fq << " Hz" << endl;
|
||||
(*it)->setTxCtcss(fq);
|
||||
}
|
||||
} /* LocalTx::setTxCtcss */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
|
|
|
|||
|
|
@ -176,6 +176,12 @@ class MultiTx : public Tx
|
|||
*/
|
||||
virtual void setTransmittedSignalStrength(float siglev);
|
||||
|
||||
/**
|
||||
* @brief Set the ctcss tone value to send over the tx
|
||||
* @param fq The tone frequency in Hz
|
||||
*/
|
||||
virtual void setTxCtcss(float fq);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -428,6 +428,21 @@ class MsgAudio : public Msg
|
|||
}; /* MsgAudio */
|
||||
|
||||
|
||||
class MsgTime : public Msg
|
||||
{
|
||||
public:
|
||||
static const unsigned TYPE = 104;
|
||||
|
||||
MsgTime(unsigned seconds, unsigned useconds)
|
||||
: Msg(TYPE, sizeof(MsgTime)), m_sec(seconds), m_usec(useconds) {}
|
||||
|
||||
unsigned seconds(void) const { return m_sec; }
|
||||
unsigned useconds(void) const { return m_usec; }
|
||||
|
||||
private:
|
||||
unsigned m_sec;
|
||||
unsigned m_usec;
|
||||
}; /* MsgTime */
|
||||
|
||||
|
||||
/******************************** RX Messages ********************************/
|
||||
|
|
@ -623,6 +638,17 @@ class MsgFlush : public Msg
|
|||
}; /* MsgFlush */
|
||||
|
||||
|
||||
class MsgSendCtcss : public Msg
|
||||
{
|
||||
public:
|
||||
static const unsigned TYPE = 304;
|
||||
MsgSendCtcss(float tone_fq)
|
||||
: Msg(TYPE, sizeof(MsgSendCtcss)), m_tone_fq(tone_fq) {}
|
||||
float Fq(void) const { return m_tone_fq; }
|
||||
|
||||
private:
|
||||
float m_tone_fq;
|
||||
}; /* MsgSendCtcss */
|
||||
|
||||
|
||||
class MsgTxTimeout : public Msg
|
||||
|
|
@ -658,6 +684,19 @@ class MsgAllSamplesFlushed : public Msg
|
|||
}; /* MsgTxTimeout */
|
||||
|
||||
|
||||
class MsgSystemLatency : public Msg
|
||||
{
|
||||
public:
|
||||
static const unsigned TYPE = 353;
|
||||
MsgSystemLatency(long latency)
|
||||
: Msg(TYPE, sizeof(MsgSystemLatency)), m_latency(latency) {}
|
||||
unsigned getLatency(void) { return m_latency; }
|
||||
|
||||
private:
|
||||
long m_latency;
|
||||
|
||||
}; /* MsgSystemLatency */
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -255,6 +255,13 @@ void NetTx::sendDtmf(const std::string& digits)
|
|||
} /* NetTx::sendDtmf */
|
||||
|
||||
|
||||
void NetTx::setTxCtcss(float fq)
|
||||
{
|
||||
MsgSendCtcss *msg = new MsgSendCtcss(fq);
|
||||
sendMsg(msg);
|
||||
} /* NetTx::setTxCtcss */
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
|
|
|
|||
|
|
@ -173,6 +173,12 @@ class NetTx : public Tx
|
|||
*/
|
||||
virtual void sendDtmf(const std::string& digits);
|
||||
|
||||
/**
|
||||
* @brief Send a float of the requested ctcss tone
|
||||
* @param fq the tone in Hz
|
||||
*/
|
||||
virtual void setTxCtcss(float fq);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
|||
|
|
@ -178,6 +178,10 @@ class Tx : public sigc::trackable, public Async::AudioSink
|
|||
*/
|
||||
virtual void setTransmittedSignalStrength(float siglev) {}
|
||||
|
||||
/**
|
||||
*/
|
||||
virtual void setTxCtcss(float fq) {}
|
||||
|
||||
/**
|
||||
* @brief This signal is emitted when the tx timeout timer expires
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue