Compare commits

...

17 Commits

Author SHA1 Message Date
Adi Bier / DL1HRC c6d273c53d Merge remote-tracking branch 'sm0svx/master' into multiple_ctcss_tx
Conflicts:
	src/svxlink/svxlink/Logic.h
2017-07-31 11:02:30 +02:00
Adi Bier/DL1HRC 5e537d3607 Merge branch 'master' of https://github.com/sm0svx/svxlink into multiple_ctcss_tx 2016-01-03 21:13:35 +01:00
Adi Bier fae410f872 Merge branch 'master' of https://github.com/sm0svx/svxlink into multiple_ctcss_tx 2015-11-24 08:10:03 +01:00
Adi Bier / DL1HRC c9e05dbe96 Merge branch 'master' of https://github.com/sm0svx/svxlink into multiple_ctcss_tx 2015-11-11 12:13:46 +00:00
Adi Bier f2009fa301 Merge branch 'master' of https://github.com/sm0svx/svxlink into multiple_ctcss_tx 2015-11-04 10:56:36 +01:00
Adi Bier/DL1HRC 363acd70f8 Merge remote-tracking branch 'upstream/master' into multiple_ctcss_tx 2015-10-27 14:20:49 +01:00
Adi Bier 0c43cc018f Merge remote-tracking branch 'upstream/master' into multiple_ctcss_tx 2015-10-05 13:12:03 +02:00
Adi Bier 677496cde5 Merge branch 'master' of https://github.com/sm0svx/svxlink into multiple_ctcss_tx 2015-06-11 11:38:25 +02:00
Adi Bier 27b1b3c2a2 changed net protocol version back to 2.4 to avoid error messages when the svxserver is used 2015-06-04 08:26:12 +02:00
Adi Bier/DL1HRC 536fd8d5e1 removed problem with spaces in NetTrxMsg.h, doc updated 2015-05-25 09:02:32 +02:00
Adi Bier/DL1HRC d5cf330e35 Merge remote-tracking branch 'upstream/master' into multiple_ctcss_tx 2015-05-24 13:15:55 +02:00
Adi Bier/DL1HRC a76fba7310 added warning when using this version together with the svxserver, downgrade MINOR 2015-05-11 16:54:36 +02:00
Adi Bier 4da3c05502 added comments in MultiTx.h and NetTx.h 2015-05-07 14:03:07 +02:00
Adi Bier 2dd4291137 added support for sending ctcss over NetTxs 2015-05-07 10:48:44 +02:00
Adi Bier 11c4aa064a added support for MultiTx 2015-05-07 10:12:08 +02:00
Adi Bier 2aac7444b8 change mapping of ctcss tones (tone[0] -> tone[1]) as the first Rx. Bugfix when no tone map has been assigned to a rx 2015-05-05 22:09:25 +02:00
Adi Bier 25429fd160 first try on sending multiple tx ctccs tones depending on rxId 2015-05-05 11:18:27 +02:00
13 changed files with 135 additions and 1 deletions

View File

@ -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.

View File

@ -249,7 +249,10 @@ class TxAdapter : public Tx, public AudioSource
}
}
/**
*/
virtual void setTxCtcss(float fq) {}
int writeSamples(const float *samples, int count)
{

View File

@ -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 =

View File

@ -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();

View File

@ -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);

View File

@ -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 */
/****************************************************************************
*

View File

@ -188,6 +188,12 @@ class LocalTx : public Tx
*/
void setTransmittedSignalStrength(float siglev);
/**
*
*/
void setTxCtcss(float fq);
private:
std::string name;
Async::Config &cfg;

View File

@ -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 */
/****************************************************************************
*

View File

@ -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:

View File

@ -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)

View File

@ -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 */
/****************************************************************************
*

View File

@ -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:

View File

@ -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
*