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