aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/Transceiver.h
diff options
context:
space:
mode:
authorThomas Tsou <ttsou@vt.edu>2012-02-28 15:41:50 -0500
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-06-24 01:50:59 +0400
commit996f426c16d7cf804fc6692e4eb4c59589e82691 (patch)
tree1afb953de58ca51662f33df3abbfddf0838d47d2 /Transceiver52M/Transceiver.h
parent711e6afddf46a3ad231521ff44836b0613a17743 (diff)
multi-arfcn, trx: split transceiver to handle multiple channels
This patch separates the 'Transceiver' into a multi-channel I/O component and single channel component. The latter may may have multiple instances. The receive FIFO is converted to a thread-safe queue. The 'TransceiverIO' continuously drives the receive and transmit loops. In this process, bursts are driven into thread-safe FIFO's and read from the priority queues. Filler bursts are inserted if no transmit data is available. Each 'Transceiver' instance attaches to the I/O object and creates its own threads and sockets, which include blocking on the receive FIFO for the attached channel. Each instance also handles its own control loop and clock indications. Signed-off-by: Thomas Tsou <ttsou@vt.edu>
Diffstat (limited to 'Transceiver52M/Transceiver.h')
-rw-r--r--Transceiver52M/Transceiver.h65
1 files changed, 15 insertions, 50 deletions
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index b23c3fa..fed2df9 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -1,5 +1,5 @@
/*
-* Copyright 2008 Free Software Foundation, Inc.
+* Copyright 2008, 2012 Free Software Foundation, Inc.
*
* This software is distributed under the terms of the GNU Public License.
* See the COPYING file in the main directory for details.
@@ -29,6 +29,7 @@
TRANSMIT_LOGGING write every burst on the given slot to a log
*/
+#include "DriveLoop.h"
#include "radioInterface.h"
#include "Interthread.h"
#include "GSMCommon.h"
@@ -44,59 +45,28 @@
class Transceiver {
private:
-
- GSM::Time mTransmitLatency; ///< latency between basestation clock and transmit deadline clock
- GSM::Time mLatencyUpdateTime; ///< last time latency was updated
+ DriveLoop *mDriveLoop;
UDPSocket mDataSocket; ///< socket for writing to/reading from GSM core
UDPSocket mControlSocket; ///< socket for writing/reading control commands from GSM core
UDPSocket mClockSocket; ///< socket for writing clock updates to GSM core
- VectorQueue mTransmitPriorityQueue; ///< priority queue of transmit bursts received from GSM core
- VectorFIFO* mTransmitFIFO; ///< radioInterface FIFO of transmit bursts
+ VectorQueue *mTransmitPriorityQueue; ///< priority queue of transmit bursts received from GSM core
VectorFIFO* mReceiveFIFO; ///< radioInterface FIFO of receive bursts
Thread *mFIFOServiceLoopThread; ///< thread to push/pull bursts into transmit/receive FIFO
Thread *mControlServiceLoopThread; ///< thread to process control messages from GSM core
Thread *mTransmitPriorityQueueServiceLoopThread;///< thread to process transmit bursts from GSM core
- GSM::Time mTransmitDeadlineClock; ///< deadline for pushing bursts into transmit FIFO
+ int mChannel; ///< channelizer attach number between 0 and 'M-1'
+
+ GSM::Time *mTransmitDeadlineClock; ///< deadline for pushing bursts into transmit FIFO
GSM::Time mLastClockUpdateTime; ///< last time clock update was sent up to core
RadioInterface *mRadioInterface; ///< associated radioInterface object
double txFullScale; ///< full scale input to radio
double rxFullScale; ///< full scale output to radio
- /** Codes for burst types of received bursts*/
- typedef enum {
- OFF, ///< timeslot is off
- TSC, ///< timeslot should contain a normal burst
- RACH, ///< timeslot should contain an access burst
- IDLE ///< timeslot is an idle (or dummy) burst
- } CorrType;
-
-
- /** Codes for channel combinations */
- typedef enum {
- FILL, ///< Channel is transmitted, but unused
- I, ///< TCH/FS
- II, ///< TCH/HS, idle every other slot
- III, ///< TCH/HS
- IV, ///< FCCH+SCH+CCCH+BCCH, uplink RACH
- V, ///< FCCH+SCH+CCCH+BCCH+SDCCH/4+SACCH/4, uplink RACH+SDCCH/4
- VI, ///< CCCH+BCCH, uplink RACH
- VII, ///< SDCCH/8 + SACCH/8
- VIII, ///< TCH/F + FACCH/F + SACCH/M
- IX, ///< TCH/F + SACCH/M
- X, ///< TCH/FD + SACCH/MD
- XI, ///< PBCCH+PCCCH+PDTCH+PACCH+PTCCH
- XII, ///< PCCCH+PDTCH+PACCH+PTCCH
- XIII, ///< PDTCH+PACCH+PTCCH
- NONE, ///< Channel is inactive, default
- LOOPBACK ///< similar go VII, used in loopback testing
- } ChannelCombination;
-
-
/** unmodulate a modulated burst */
#ifdef TRANSMIT_LOGGING
void unModulateVector(signalVector wVector);
@@ -115,29 +85,22 @@ private:
int &RSSI,
int &timingOffset);
- /** Set modulus for specific timeslot */
- void setModulus(int timeslot);
-
- /** return the expected burst type for the specified timestamp */
- CorrType expectedCorrType(GSM::Time currTime);
-
/** send messages over the clock socket */
void writeClockInterface(void);
+ void pullFIFO(void); ///< blocking call on receive FIFO
+
signalVector *gsmPulse; ///< the GSM shaping pulse for modulation
int mSamplesPerSymbol; ///< number of samples per GSM symbol
bool mOn; ///< flag to indicate that transceiver is powered on
- ChannelCombination mChanType[8]; ///< channel types for all timeslots
double mTxFreq; ///< the transmit frequency
double mRxFreq; ///< the receive frequency
int mPower; ///< the transmit power in dB
int mTSC; ///< the midamble sequence code
double mEnergyThreshold; ///< threshold to determine if received data is potentially a GSM burst
GSM::Time prevFalseDetectionTime; ///< last timestamp of a false energy detection
- int fillerModulus[8]; ///< modulus values of all timeslots, in frames
- signalVector *fillerTable[102][8]; ///< table of modulated filler waveforms for all timeslots
unsigned mMaxExpectedDelay; ///< maximum expected time-of-arrival offset in GSM symbols
GSM::Time channelEstimateTime[8]; ///< last timestamp of each timeslot's channel estimate
@@ -148,6 +111,8 @@ private:
float chanRespOffset[8]; ///< most recent timing offset, e.g. TOA, of all timeslots
complex chanRespAmplitude[8]; ///< most recent channel amplitude of all timeslots
+ bool mRadioLocked;
+
public:
/** Transceiver constructor
@@ -160,9 +125,9 @@ public:
Transceiver(int wBasePort,
const char *TRXAddress,
int wSamplesPerSymbol,
- GSM::Time wTransmitLatency,
- RadioInterface *wRadioInterface);
-
+ RadioInterface *wRadioInterface,
+ DriveLoop *wDriveLoop,
+ int wChannel);
/** Destructor */
~Transceiver();
@@ -173,7 +138,7 @@ public:
void receiveFIFO(VectorFIFO *wFIFO) { mReceiveFIFO = wFIFO;}
/** attach the radioInterface transmit FIFO */
- void transmitFIFO(VectorFIFO *wFIFO) { mTransmitFIFO = wFIFO;}
+ void transmitQueue(VectorQueue *wQ) { mTransmitPriorityQueue = wQ; }
protected: