mirror of
https://github.com/fairwaves/openbts-2.8.git
synced 2025-10-22 23:32:00 +00:00
Transceiver52M: add antenna selection from configuration
Set optional transmit and receive antennas from database configuration file. Use default antenna values on empty string or if option does not exist. Signed-off-by: Thomas Tsou <tom@tsou.cc>
This commit is contained in:
committed by
Alexander Chemeris
parent
43d74948ff
commit
72b4d2dd9c
@@ -183,6 +183,10 @@ public:
|
||||
double setTxGain(double db);
|
||||
double maxTxGain(void) { return tx_gain_max; }
|
||||
double minTxGain(void) { return tx_gain_min; }
|
||||
void setTxAntenna(std::string &name);
|
||||
void setRxAntenna(std::string &name);
|
||||
std::string getRxAntenna();
|
||||
std::string getTxAntenna();
|
||||
|
||||
double getTxFreq() { return tx_freq; }
|
||||
double getRxFreq() { return rx_freq; }
|
||||
@@ -385,6 +389,26 @@ double uhd_device::setRxGain(double db)
|
||||
return rx_gain;
|
||||
}
|
||||
|
||||
void uhd_device::setTxAntenna(std::string &name)
|
||||
{
|
||||
usrp_dev->set_tx_antenna(name);
|
||||
}
|
||||
|
||||
void uhd_device::setRxAntenna(std::string &name)
|
||||
{
|
||||
usrp_dev->set_rx_antenna(name);
|
||||
}
|
||||
|
||||
std::string uhd_device::getTxAntenna()
|
||||
{
|
||||
return usrp_dev->get_tx_antenna();
|
||||
}
|
||||
|
||||
std::string uhd_device::getRxAntenna()
|
||||
{
|
||||
return usrp_dev->get_rx_antenna();
|
||||
}
|
||||
|
||||
/*
|
||||
Parse the UHD device tree and mboard name to find out what device we're
|
||||
dealing with. We need the bus type so that the transceiver knows how to
|
||||
|
@@ -117,6 +117,12 @@ class RadioDevice {
|
||||
/** return minimum Tx Gain **/
|
||||
virtual double minTxGain(void) = 0;
|
||||
|
||||
/** set and return antennas selection **/
|
||||
virtual void setTxAntenna(std::string &name) = 0;
|
||||
virtual void setRxAntenna(std::string &name) = 0;
|
||||
virtual std::string getRxAntenna() = 0;
|
||||
virtual std::string getTxAntenna() = 0;
|
||||
|
||||
/** Return internal status values */
|
||||
virtual double getTxFreq()=0;
|
||||
virtual double getRxFreq()=0;
|
||||
|
@@ -58,6 +58,7 @@ static void ctrlCHandler(int signo)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::string deviceArgs;
|
||||
std::string txAntenna, rxAntenna;
|
||||
|
||||
if (argc == 3)
|
||||
{
|
||||
@@ -95,9 +96,23 @@ int main(int argc, char *argv[])
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (gConfig.defines("GSM.Radio.TxAntenna"))
|
||||
txAntenna = gConfig.getStr("GSM.Radio.TxAntenna").c_str();
|
||||
if (gConfig.defines("GSM.Radio.RxAntenna"))
|
||||
rxAntenna = gConfig.getStr("GSM.Radio.RxAntenna").c_str();
|
||||
|
||||
if (txAntenna != "")
|
||||
usrp->setTxAntenna(txAntenna);
|
||||
if (rxAntenna != "")
|
||||
usrp->setRxAntenna(rxAntenna);
|
||||
|
||||
LOG(INFO) << "transceiver using transmit antenna " << usrp->getRxAntenna();
|
||||
LOG(INFO) << "transceiver using receive antenna " << usrp->getTxAntenna();
|
||||
|
||||
RadioInterface* radio = new RadioInterface(usrp,3,SAMPSPERSYM,mOversamplingRate,false);
|
||||
Transceiver *trx = new Transceiver(gConfig.getNum("TRX.Port"),gConfig.getStr("TRX.IP").c_str(),SAMPSPERSYM,GSM::Time(3,0),radio);
|
||||
trx->receiveFIFO(radio->receiveFIFO());
|
||||
|
||||
/*
|
||||
signalVector *gsmPulse = generateGSMPulse(2,1);
|
||||
BitVector normalBurstSeg = "0000101010100111110010101010010110101110011000111001101010000";
|
||||
|
@@ -58,6 +58,8 @@ INSERT INTO "CONFIG" VALUES('GSM.RACH.MaxRetrans','1',0,0,'Maximum RACH retransm
|
||||
INSERT INTO "CONFIG" VALUES('GSM.RACH.TxInteger','14',0,0,'Parameter to spread RACH busts over time. This is the raw parameter sent on the BCCH. See GSM 04.08 10.5.2.29 for encoding.');
|
||||
INSERT INTO "CONFIG" VALUES('GSM.Radio.ARFCNs','1 ',1,0,'The number of ARFCNs to use. The ARFCN set will be C0, C0+2, C0+4, etc. Static.');
|
||||
INSERT INTO "CONFIG" VALUES('GSM.Radio.UHDargs','addr=192.168.10.2',0,0,'Arguments to pass to UHD.');
|
||||
INSERT INTO "CONFIG" VALUES('GSM.Radio.TxAntenna','',0,0,'Transmit antenna string to pass to UHD.');
|
||||
INSERT INTO "CONFIG" VALUES('GSM.Radio.RxAntenna','',0,0,'Receive antenna string to pass to UHD.');
|
||||
INSERT INTO "CONFIG" VALUES('GSM.RADIO-LINK-TIMEOUT','15',0,0,' L1 radio link timeout. This is the raw parameter sent on the BCCH; see GSM 10.5.2.3 for encoding. Should be coordinated with T3109.');
|
||||
INSERT INTO "CONFIG" VALUES('GSM.RRLP.ACCURACY','40',0,0,'Requested accuracy of location request. K in 10(1.1**K-1). See 3GPP 03.32, sect 6.2');
|
||||
INSERT INTO "CONFIG" VALUES('GSM.RRLP.ALMANAC.REFRESH.TIME','24.0',0,0,'How often the almanac is refreshed, in hours');
|
||||
|
Reference in New Issue
Block a user