18 #include <boost/endian/conversion.hpp> 24 m_sampleFifo(sampleFifo),
26 m_centerFrequency(1450000),
31 connect(&
m_timer, SIGNAL(timeout()),
this, SLOT(
tick()));
36 connect(&
m_webSocket, &QWebSocket::binaryMessageReceived,
38 connect(&
m_webSocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error),
51 qDebug(
"KiwiSDRWorker::onDisconnected");
68 QString msg =
"SET mod=iq low_cut=-5980 high_cut=5980 freq=" + freq;
77 QString msg(
"SET agc=");
79 msg.append(
" hang=0 thresh=-130 slope=6 decay=1000 manGain=");
80 msg.append(QString::number(
m_gain));
86 if (message[0] ==
'M' && message[1] ==
'S' && message[2] ==
'G')
88 QStringList al = QString::fromUtf8(message).split(
' ');
89 if (al[1] ==
"audio_init=0" &&
90 al[2] ==
"audio_rate=12000")
92 m_webSocket.sendTextMessage(
"SET AR OK in=12000 out=48000");
93 m_webSocket.sendTextMessage(
"SERVER DE CLIENT KiwiAngel SND");
101 else if (message[0] ==
'S' && message[1] ==
'N' && message[2] ==
'D')
104 int sampleCount = 512;
105 const int16_t* messageSamples = (
const int16_t*)(message.constData() + dataOffset);
108 for (
int i = 0;
i < sampleCount;
i++)
111 boost::endian::endian_reverse(messageSamples[
i * 2]) << (
SDR_RX_SAMP_SZ - 16),
112 boost::endian::endian_reverse(messageSamples[i * 2 + 1]) << (
SDR_RX_SAMP_SZ - 16)
149 QString url(
"ws://");
151 url.append(
"/kiwi/");
152 url.append(QString::number(QDateTime::currentMSecsSinceEpoch()));
void onCenterFrequencyChanged(quint64 centerFrequency)
SampleVector m_samplesBuf
void sendCenterFrequency()
uint write(const quint8 *data, uint count)
KiwiSDRWorker(SampleSinkFifo *sampleFifo)
uint64_t m_centerFrequency
SampleSinkFifo * m_sampleFifo
void onBinaryMessageReceived(const QByteArray &message)
void updateStatus(int status)
void onServerAddressChanged(QString serverAddress)
void onSocketError(QAbstractSocket::SocketError error)
void onGainChanged(quint32 gain, bool useAGC)
int m_status
See GUI for status number detail.