Transceiver52M: Delay socket allocation to heap
For multiple transceiver connections, it is inappropriate to
allocate all sockets in the transceiver constructor due to not
knowing how many connections are avaialble in advance and for
error checking purposes. Instead, store the base socket address
port combination and setup the sockets in the initialization
call.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index c3be343..4b549ef 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -32,15 +32,15 @@
/** The Transceiver class, responsible for physical layer of basestation */
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
- 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
+ UDPSocket *mDataSocket; ///< socket for writing to/reading from GSM core
+ UDPSocket *mCtrlSocket; ///< 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