device: Drop unused numberRead/numberWritten APIs
It's really not used, so let's drop unused code and simplify work for new to come device drivers implementation. Change-Id: I0d18f9c2584771e2f7b3d5c6b016e764e02855ff
This commit is contained in:
parent
51509b3895
commit
7214fde085
|
@ -238,8 +238,6 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels)
|
|||
goto out_close;
|
||||
}
|
||||
|
||||
samplesRead = 0;
|
||||
samplesWritten = 0;
|
||||
started = false;
|
||||
|
||||
return NORMAL;
|
||||
|
@ -630,8 +628,6 @@ int LMSDevice::readSamples(std::vector < short *>&bufs, int len, bool * overrun,
|
|||
thread_enable_cancel(true);
|
||||
}
|
||||
|
||||
samplesRead += rc;
|
||||
|
||||
if (((TIMESTAMP) rx_metadata.timestamp) < timestamp)
|
||||
rc = 0;
|
||||
|
||||
|
@ -678,8 +674,6 @@ int LMSDevice::writeSamples(std::vector < short *>&bufs, int len,
|
|||
thread_enable_cancel(true);
|
||||
}
|
||||
|
||||
samplesWritten += rc;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,9 +55,6 @@ private:
|
|||
|
||||
double actualSampleRate; ///< the actual USRP sampling rate
|
||||
|
||||
unsigned long long samplesRead; ///< number of samples read from LMS
|
||||
unsigned long long samplesWritten; ///< number of samples sent to LMS
|
||||
|
||||
bool started; ///< flag indicates LMS has started
|
||||
bool skipRx; ///< set if LMS is transmit-only.
|
||||
|
||||
|
@ -203,12 +200,6 @@ public:
|
|||
inline double getSampleRate() {
|
||||
return actualSampleRate;
|
||||
}
|
||||
inline double numberRead() {
|
||||
return samplesRead;
|
||||
}
|
||||
inline double numberWritten() {
|
||||
return samplesWritten;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _LMS_DEVICE_H_
|
||||
|
|
|
@ -161,8 +161,6 @@ class RadioDevice {
|
|||
virtual double getTxFreq(size_t chan = 0) = 0;
|
||||
virtual double getRxFreq(size_t chan = 0) = 0;
|
||||
virtual double getSampleRate()=0;
|
||||
virtual double numberRead()=0;
|
||||
virtual double numberWritten()=0;
|
||||
|
||||
protected:
|
||||
size_t tx_sps, rx_sps;
|
||||
|
|
|
@ -165,7 +165,7 @@ uhd_device::uhd_device(size_t tx_sps, size_t rx_sps,
|
|||
tx_gain_min(0.0), tx_gain_max(0.0),
|
||||
rx_gain_min(0.0), rx_gain_max(0.0),
|
||||
tx_spp(0), rx_spp(0),
|
||||
started(false), aligned(false), rx_pkt_cnt(0), drop_cnt(0),
|
||||
started(false), aligned(false), drop_cnt(0),
|
||||
prev_ts(0,0), ts_initial(0), ts_offset(0), async_event_thrd(NULL)
|
||||
{
|
||||
}
|
||||
|
@ -725,8 +725,6 @@ int uhd_device::readSamples(std::vector<short *> &bufs, int len, bool *overrun,
|
|||
metadata, 0.1, true);
|
||||
thread_enable_cancel(true);
|
||||
|
||||
rx_pkt_cnt++;
|
||||
|
||||
// Check for errors
|
||||
rc = check_rx_md_err(metadata, num_smpls);
|
||||
switch (rc) {
|
||||
|
|
|
@ -112,8 +112,6 @@ public:
|
|||
GSM::Time minLatency();
|
||||
|
||||
inline double getSampleRate() { return tx_rate; }
|
||||
inline double numberRead() { return rx_pkt_cnt; }
|
||||
inline double numberWritten() { return 0; }
|
||||
|
||||
/** Receive and process asynchronous message
|
||||
@return true if message received or false on timeout or error
|
||||
|
@ -146,7 +144,6 @@ private:
|
|||
bool started;
|
||||
bool aligned;
|
||||
|
||||
size_t rx_pkt_cnt;
|
||||
size_t drop_cnt;
|
||||
uhd::time_spec_t prev_ts;
|
||||
|
||||
|
|
|
@ -173,8 +173,6 @@ int USRPDevice::open(const std::string &, int, bool)
|
|||
m_dbTx = m_uTx->selected_subdev(txSubdevSpec);
|
||||
m_dbRx = m_uRx->selected_subdev(rxSubdevSpec);
|
||||
|
||||
samplesRead = 0;
|
||||
samplesWritten = 0;
|
||||
started = false;
|
||||
|
||||
return NORMAL;
|
||||
|
@ -505,7 +503,6 @@ int USRPDevice::readSamples(std::vector<short *> &bufs, int len, bool *overrun,
|
|||
gettimeofday(&lastReadTime,NULL);
|
||||
firstRead = true;
|
||||
}
|
||||
samplesRead += numSamples;
|
||||
|
||||
return numSamples;
|
||||
#endif
|
||||
|
@ -555,14 +552,12 @@ int USRPDevice::writeSamples(std::vector<short *> &bufs, int len,
|
|||
}
|
||||
m_uTx->write((const void*) outPkt,sizeof(uint32_t)*128*numPkts,NULL);
|
||||
|
||||
samplesWritten += len/2/sizeof(short);
|
||||
writeLock.unlock();
|
||||
|
||||
return len/2/sizeof(short);
|
||||
#else
|
||||
int retVal = len;
|
||||
memcpy(loopbackBuffer+loopbackBufferSize,buf,sizeof(short)*2*len);
|
||||
samplesWritten += retVal;
|
||||
loopbackBufferSize += retVal*2;
|
||||
|
||||
return retVal;
|
||||
|
|
|
@ -51,9 +51,6 @@ private:
|
|||
double actualSampleRate; ///< the actual USRP sampling rate
|
||||
unsigned int decimRate; ///< the USRP decimation rate
|
||||
|
||||
unsigned long long samplesRead; ///< number of samples read from USRP
|
||||
unsigned long long samplesWritten; ///< number of samples sent to USRP
|
||||
|
||||
bool started; ///< flag indicates USRP has started
|
||||
|
||||
static const unsigned int currDataSize_log2 = 21;
|
||||
|
@ -201,8 +198,6 @@ private:
|
|||
inline double getTxFreq(size_t chan = 0) { return 0; }
|
||||
inline double getRxFreq(size_t chan = 0) { return 0; }
|
||||
inline double getSampleRate() { return actualSampleRate; }
|
||||
inline double numberRead() { return samplesRead; }
|
||||
inline double numberWritten() { return samplesWritten; }
|
||||
};
|
||||
|
||||
#endif // _USRP_DEVICE_H_
|
||||
|
|
Loading…
Reference in New Issue