11 #ifndef INCLUDED_LIBCYBERRADIO_NDR651_UDPSTATUSRECEIVER_H_ 12 #define INCLUDED_LIBCYBERRADIO_NDR651_UDPSTATUSRECEIVER_H_ 14 #include <boost/thread/mutex.hpp> 15 #include "LibCyberRadio/Common/Debuggable.h" 16 #include "LibCyberRadio/Common/Thread.h" 18 #define MAX_RX_SIZE 8192 19 #define MAX_RADIO_BUFFSIZE 67108862 // (2^26)-2 samples 20 #define RADIO_BUFFER_RESERVE 1048576 88 bool okToSend(
long int pendingSamples,
bool lockIfOk);
101 bool setUpdatePE(
bool updatePE);
102 bool getUpdatePE(
void) {
return _updatePE; };
103 int setMaxFreeSpace(
float fs,
float maxLatency);
104 int getMaxFreeSpace(
void) {
return _freeSpaceMax; };
106 int getUdpPort(
void) {
return _port; };
110 char _rxbuff[MAX_RX_SIZE];
112 boost::mutex _fcMutex, _selMutex;
119 uint64_t timeoutCount;
124 bool _makeSocket(
void);
125 bool _setFreeSpace(
int,
bool,
bool,
bool);
bool okToSend(long int pendingSamples, bool lockIfOk)
Determines if it is OK to send data.
bool sentNSamples(long int samplesSent)
Updates status based on the number of samples sent.
bool setStatusInterface(std::string ifname)
Sets the interface name.
Class that supports debug output.
virtual ~UdpStatusReceiver()
Destroys a UdpStatusReceiver object.
virtual void run()
Executes the main processing loop for the thread.
long int getFreeSpace(void)
Gets the amount of free space available.
UdpStatusReceiver(std::string ifname, unsigned int port, bool debug, bool updatePE)
Constructs a UdpStatusReceiver object.
virtual int debug(const char *format,...)
Outputs debug information.
Defines functionality for LibCyberRadio applications.
bool setStatusPort(unsigned int port)
Sets the UDP port.
Base class for a thread object, based on Boost Threads.