/*
* Copyright 2008 Free Software Foundation, Inc.
*
* This software is distributed under the terms of the GNU Affero Public License.
* See the COPYING file in the main directory for details.
*
* This use of this software may be subject to additional restrictions.
* See the LEGAL file in the main directory for details.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
#ifndef TRXMANAGER_H
#define TRXMANAGER_H
#include
#include
#include
#include "Threads.h"
#include "Sockets.h"
#include "Interthread.h"
#include "GSMCommon.h"
#include "GSMTransfer.h"
#include
/* Forward refs into the GSM namespace. */
namespace GSM {
class L1Decoder;
};
class ARFCNManager;
/**
The TransceiverManager processes the complete transcevier interface.
There is one of these for each access point.
*/
class TransceiverManager {
private:
/// the ARFCN manangers under this TRX
std::vector mARFCNs;
/// set true when the first CLOCK packet is received
volatile bool mHaveClock;
/// socket for clock management messages
UDPSocket mClockSocket;
/// a thread to monitor the global clock socket
Thread mClockThread;
public:
/**
Construct a TransceiverManager.
@param numARFCNs Number of ARFCNs supported by the transceiver.
@param wTRXAddress IP address of the transceiver.
@param wBasePort The base port for the interface, as defined in README.TRX.
*/
TransceiverManager(int numARFCNs,
const char* wTRXAddress, int wBasePort);
/**@name Accessors. */
//@{
ARFCNManager* ARFCN(unsigned i) { assert(i