11#ifndef INCLUDED_LIBCYBERRADIO_NDR651_TRANSMITPACKETIZER_H
12#define INCLUDED_LIBCYBERRADIO_NDR651_TRANSMITPACKETIZER_H
14#include "LibCyberRadio/Common/Debuggable.h"
15#include "LibCyberRadio/NDR651/FlowControlClient.h"
16#include "LibCyberRadio/NDR651/PacketTypes.h"
17#include "LibCyberRadio/NDR651/TransmitSocket.h"
18#include "LibCyberRadio/NDR651/UdpStatusReceiver.h"
20bool setCpuAffinity(
int cpu);
59 int radioTcpPort = 8617,
60 unsigned int ducChannel = 1,
61 const std::string& ifname =
"eth0",
62 unsigned int tenGigIndex = 1,
64 unsigned int ducRate = 0,
65 unsigned int ducTxChannels = 0,
66 float ducFreq = 900e6,
70 unsigned int streamId = 40001,
71 bool config_tx =
false,
102 unsigned int tenGigIndex);
164 const std::string& radioHostName,
179 unsigned int ducRate,
180 unsigned int ducTxChannels,
185 unsigned int streamId);
212 void setDuchsParameters(
unsigned int duchsPfThresh,
unsigned int duchsPeThresh,
unsigned int duchsPeriod,
bool updatePE);
213 unsigned int getDuchsPfThresh(
void) {
return _duchsPfThresh; };
214 unsigned int getDuchsPeThresh(
void) {
return _duchsPeThresh; };
215 unsigned int getDuchsPeriod(
void) {
return _duchsPeriod; };
216 bool getUpdatePE(
void) {
return _updatePE; };
219 unsigned int _waitLoop(
void);
220 void _incrementVitaHeader(
void);
221 bool setEthernetHeader(
const std::string& sourceMac,
222 const std::string& destMac);
223 bool setIpHeader(
const std::string& sourceIp,
224 const std::string& destIp);
225 bool setUdpHeader(
unsigned short sourcePort,
226 unsigned short destPort);
227 bool setVitaHeader(
unsigned int streamId);
230 unsigned int _frameCount, _pauseCount;
232 std::string _radioHostName;
235 unsigned int _ducChannel;
237 unsigned int _tenGigIndex;
239 unsigned int _ducRate;
240 unsigned int _ducTxChannels;
245 unsigned int _streamId;
250 std::vector<TransmitSocket *> _txSockVec;
251 unsigned int _numSock, _currentSockIndex;
255 unsigned char * _frameStart;
256 unsigned int _frameLength;
258 unsigned int _samplesSent;
263 unsigned short _sPort;
264 unsigned short _dPort;
268 struct timespec _delayTime;
269 unsigned int _samplesPerFrame;
270 unsigned int _duchsPeriod, _duchsPfThresh, _duchsPeThresh;
272 unsigned int _txinvMode;
virtual int debug(const char *format,...)
Outputs debug information.
Debuggable(bool debug=false, const std::string &debug_name="", FILE *debug_fp=DEBUG_FP, const std::string &debug_timefmt=DEBUG_TIME_FMT)
Constructs a Debuggable object.
Flow control client class.
bool setDucFreq(float ducFreq)
Sets the DUC frequency.
unsigned int sendFrame(short *samples)
Sends a number of samples as a VITA 49 frame.
bool setDebug(bool debug)
Sets whether or not to produce debug output.
bool setRadioHostName(const std::string &radioHostName)
Sets the radio host name.
bool setTxFreq(double txFreq)
Sets the transmitter frequency.
bool isConnected(void)
Gets whether or not the packetizer is connected.
bool setDucRate(unsigned int ducRate)
Sets the DUC rate index.
void start()
Starts the packetizer.
TransmitPacketizer(const std::string &radioHostName="", int radioTcpPort=8617, unsigned int ducChannel=1, const std::string &ifname="eth0", unsigned int tenGigIndex=1, int dipIndex=-1, unsigned int ducRate=0, unsigned int ducTxChannels=0, float ducFreq=900e6, float ducAtten=0, double txFreq=900, float txAtten=0, unsigned int streamId=40001, bool config_tx=false, bool debug=false)
Constructs a TransmitPacketizer object.
virtual ~TransmitPacketizer()
Destroys a TransmitPacketizer object.
bool setStreamId(unsigned int streamId)
Sets the stream ID.
void stop()
Stops the packetizer.
bool setRadioTcpPort(int radioTcpPort)
Sets the radio TCP port.
bool setDucParameters(unsigned int tenGigIndex, unsigned int ducRate, unsigned int ducTxChannels, float ducFreq, float ducAtten, double txFreq, float txAtten, unsigned int streamId)
Sets the DUC parameters.
bool setDucInterface(const std::string &ifname, unsigned int tenGigIndex)
Sets the DUC interface parameters.
bool setRadioParameters(const std::string &radioHostName, int radioTcpPort)
Sets the radio parameters.
bool setTxAtten(float txAtten)
Sets the transmitter attenuation.
bool isReadyToReceive(void)
Gets whether or not the packetizer is ready to receive data.
bool setDucChannel(unsigned int ducChannel)
Sets the DUC channel number.
bool setDucTxinvMode(unsigned int txinvMode)
Sets the DUC TX Inversion Mode.
bool setDucAtten(float ducAtten)
Sets the DUC attenuation.
bool setDucTxChannels(unsigned int ducTxChannels)
Sets the DUC transmit channel bitmap.
Provides programming elements for controlling the CyberRadio Solutions NDR651 radio.
Defines functionality for LibCyberRadio applications.
VITA 49 transmit-over-UDP frame information.