diff options
author | Tom Tsou <tom@tsou.cc> | 2014-11-25 16:06:32 -0800 |
---|---|---|
committer | Tom Tsou <tom@tsou.cc> | 2014-12-15 16:20:15 -0700 |
commit | eb54bddf47e087cf340c8a65b36a03cebd4f174b (patch) | |
tree | d9c41dfef5c514a143c521f7cd138af950a34122 /Transceiver52M/Transceiver.h | |
parent | a4d1a4124421473f5f92255e2f3bc44bfa3937ea (diff) |
Transceiver52M: Implement POWEROFF command
Add stop and restart capability through the POWEROFF and POWERON
commands. Calling stop causes receive streaming to cease, and I/O
threads to shutdown leaving only the control handling thread running.
Upon receiving a POWERON command, I/O threads and device streaming are
restarted.
Proper shutdown of the transceiver is now initiated by the destructor,
which calls the stop command internally to wind down and deallocate
threads.
Signed-off-by: Tom Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/Transceiver.h')
-rw-r--r-- | Transceiver52M/Transceiver.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index 56f9115..0b81511 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -91,12 +91,10 @@ class Transceiver { private: int mBasePort; std::string mAddr; - GSM::Time mTransmitLatency; ///< latency between basestation clock and transmit deadline clock - GSM::Time mLatencyUpdateTime; ///< last time latency was updated std::vector<UDPSocket *> mDataSockets; ///< socket for writing to/reading from GSM core std::vector<UDPSocket *> mCtrlSockets; ///< socket for writing/reading control commands from GSM core - UDPSocket *mClockSocket; ///< socket for writing clock updates to GSM core + UDPSocket mClockSocket; ///< socket for writing clock updates to GSM core std::vector<VectorQueue> mTxPriorityQueues; ///< priority queue of transmit bursts received from GSM core std::vector<VectorFIFO *> mReceiveFIFO; ///< radioInterface FIFO of receive bursts @@ -107,6 +105,8 @@ private: std::vector<Thread *> mControlServiceLoopThreads; ///< thread to process control messages from GSM core std::vector<Thread *> mTxPriorityQueueServiceLoopThreads; ///< thread to process transmit bursts from GSM core + GSM::Time mTransmitLatency; ///< latency between basestation clock and transmit deadline clock + GSM::Time mLatencyUpdateTime; ///< last time latency was updated GSM::Time mTransmitDeadlineClock; ///< deadline for pushing bursts into transmit FIFO GSM::Time mLastClockUpdateTime; ///< last time clock update was sent up to core @@ -173,6 +173,13 @@ private: std::vector<TransceiverState> mStates; + /** Start and stop I/O threads through the control socket API */ + bool start(); + void stop(); + + /** Protect destructor accessable stop call */ + Mutex mLock; + public: /** Transceiver constructor @@ -191,8 +198,7 @@ public: /** Destructor */ ~Transceiver(); - /** start the Transceiver */ - void start(); + /** Start the control loop */ bool init(bool filler); /** attach the radioInterface receive FIFO */ |