本文整理汇总了C++中TransceiverManager::start方法的典型用法代码示例。如果您正苦于以下问题:C++ TransceiverManager::start方法的具体用法?C++ TransceiverManager::start怎么用?C++ TransceiverManager::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransceiverManager
的用法示例。
在下文中一共展示了TransceiverManager::start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
try {
srandom(time(NULL));
gConfig.setUpdateHook(purgeConfig);
gLogInit("openbts",gConfig.getStr("Log.Level").c_str(),LOG_LOCAL7);
LOG(ALERT) << "OpenBTS starting, ver " << VERSION << " build date " << __DATE__;
COUT("\n\n" << gOpenBTSWelcome << "\n");
gTMSITable.open(gConfig.getStr("Control.Reporting.TMSITable").c_str());
gTransactionTable.init();
gPhysStatus.open(gConfig.getStr("Control.Reporting.PhysStatusTable").c_str());
gBTS.init();
gSubscriberRegistry.init();
gParser.addCommands();
COUT("\nStarting the system...");
Thread transceiverThread;
transceiverThread.start((void*(*)(void*)) startTransceiver, NULL);
// Start the SIP interface.
gSIPInterface.start();
//
// Configure the radio.
//
// Start the transceiver interface.
// Sleep long enough for the USRP to bootload.
sleep(5);
gTRX.start();
// Set up the interface to the radio.
// Get a handle to the C0 transceiver interface.
ARFCNManager* C0radio = gTRX.ARFCN();
// Tuning.
// Make sure its off for tuning.
C0radio->powerOff();
// Get the ARFCN list.
unsigned C0 = gConfig.getNum("GSM.Radio.C0");
// Tune the radio.
LOG(INFO) << "tuning TRX to ARFCN " << C0;
ARFCNManager* radio = gTRX.ARFCN();
radio->tune(C0);
// Set TSC same as BCC everywhere.
C0radio->setTSC(gBTS.BCC());
// Set maximum expected delay spread.
C0radio->setMaxDelay(gConfig.getNum("GSM.Radio.MaxExpectedDelaySpread"));
// Set Receiver Gain
C0radio->setRxGain(gConfig.getNum("GSM.Radio.RxGain"));
// Turn on and power up.
C0radio->powerOn();
C0radio->setPower(gConfig.getNum("GSM.Radio.PowerManager.MinAttenDB"));
//
// Create a C-V channel set on C0T0.
//
// C-V on C0T0
C0radio->setSlot(0,5);
// SCH
SCHL1FEC SCH;
SCH.downstream(C0radio);
SCH.open();
// FCCH
FCCHL1FEC FCCH;
FCCH.downstream(C0radio);
FCCH.open();
// BCCH
BCCHL1FEC BCCH;
BCCH.downstream(C0radio);
BCCH.open();
// RACH
RACHL1FEC RACH(gRACHC5Mapping);
RACH.downstream(C0radio);
RACH.open();
// CCCHs
CCCHLogicalChannel CCCH0(gCCCH_0Mapping);
CCCH0.downstream(C0radio);
CCCH0.open();
CCCHLogicalChannel CCCH1(gCCCH_1Mapping);
CCCH1.downstream(C0radio);
CCCH1.open();
CCCHLogicalChannel CCCH2(gCCCH_2Mapping);
CCCH2.downstream(C0radio);
CCCH2.open();
// use CCCHs as AGCHs
gBTS.addAGCH(&CCCH0);
gBTS.addAGCH(&CCCH1);
gBTS.addAGCH(&CCCH2);
//.........这里部分代码省略.........
示例2: main
int main(int argc, char *argv[])
{
//mtrace(); // (pat) Enable memory leak detection. Unfortunately, huge amounts of code have been started in the constructors above.
gLogGroup.setAll();
// TODO: Properly parse and handle any arguments
if (argc > 1) {
bool testflag = false;
for (int argi = 1; argi < argc; argi++) { // Skip argv[0] which is the program name.
if (!strcmp(argv[argi], "--version") || !strcmp(argv[argi], "-v")) {
// Print the version number and exit immediately.
cout << gVersionString << endl;
return 0;
}
if (!strcmp(argv[argi], "--test")) {
testflag = true;
continue;
}
if (!strcmp(argv[argi], "--gensql")) {
cout << gConfig.getDefaultSQL(string(argv[0]), gVersionString) << endl;
return 0;
}
if (!strcmp(argv[argi], "--gentex")) {
cout << gConfig.getTeX(string(argv[0]), gVersionString) << endl;
return 0;
}
// (pat) Adding support for specified sql file.
// Unfortunately, the Config table was inited quite some time ago,
// so stick this arg in the environment, whence the ConfigurationTable can find it, and then reboot.
if (!strcmp(argv[argi],"--config")) {
if (++argi == argc) {
LOG(ALERT) <<"Missing argument to --config option";
exit(2);
}
setenv(cOpenBTSConfigEnv,argv[argi],1);
execl(argv[0],"OpenBTS",NULL);
LOG(ALERT) <<"execl failed? Exiting...";
exit(0);
}
if (!strcmp(argv[argi],"--help")) {
printf("OpenBTS [--version --gensql --gentex] [--config file.db]\n");
printf("OpenBTS exiting...\n");
exit(0);
}
printf("OpenBTS: unrecognized argument: %s\nexiting...\n",argv[argi]);
}
if (testflag) { GSM::TestTCHL1FEC(); return 0; }
}
createStats();
gConfig.setCrossCheckHook(&configurationCrossCheck);
gReports.incr("OpenBTS.Starts");
gNeighborTable.NeighborTableInit(
gConfig.getStr("Peering.NeighborTable.Path").c_str());
int sock = socket(AF_UNIX,SOCK_DGRAM,0);
if (sock<0) {
perror("creating CLI datagram socket");
LOG(ALERT) << "cannot create socket for CLI";
gReports.incr("OpenBTS.Exit.CLI.Socket");
exit(1);
}
try {
srandom(time(NULL));
gConfig.setUpdateHook(purgeConfig);
LOG(ALERT) << "OpenBTS (re)starting, ver " << VERSION << " build date " << __DATE__;
LOG(ALERT) << "OpenBTS reading config file "<<cOpenBTSConfigFile;
COUT("\n\n" << gOpenBTSWelcome << "\n");
Control::controlInit(); // init Layer3: TMSITable, TransactionTable.
gPhysStatus.open(gConfig.getStr("Control.Reporting.PhysStatusTable").c_str());
gBTS.init();
gParser.addCommands();
COUT("\nStarting the system...");
// is the radio running?
// Start the transceiver interface.
LOG(INFO) << "checking transceiver";
//gTRX.ARFCN(0)->powerOn();
//sleep(gConfig.getNum("TRX.Timeout.Start"));
//bool haveTRX = gTRX.ARFCN(0)->powerOn(false); This prints an inapplicable warning message.
bool haveTRX = gTRX.ARFCN(0)->trxRunning(); // This does not print an inapplicable warning message.
Thread transceiverThread;
if (!haveTRX) {
LOG(ALERT) << "starting the transceiver";
transceiverThread.start((void*(*)(void*)) startTransceiver, NULL);
// sleep to let the FPGA code load
// TODO: we should be "pinging" the radio instead of sleeping
sleep(5);
} else {
//.........这里部分代码省略.........
示例3: main
int main(int argc, char *argv[])
{
srandom(time(NULL));
COUT("\n\n" << gOpenBTSWelcome << "\n");
COUT("\nStarting the system...");
gSetLogLevel(gConfig.getStr("LogLevel"));
if (gConfig.defines("LogFileName")) {
gSetLogFile(gConfig.getStr("LogFileName"));
}
// Start the transceiver binary, if the path is defined.
// If the path is not defined, the transceiver must be started by some other process.
const char *TRXPath = NULL;
if (gConfig.defines("TRX.Path")) TRXPath=gConfig.getStr("TRX.Path");
pid_t transceiverPid = 0;
if (TRXPath) {
const char *TRXLogLevel = gConfig.getStr("TRX.LogLevel");
const char *TRXLogFileName = NULL;
if (gConfig.defines("TRX.LogFileName")) TRXLogFileName=gConfig.getStr("TRX.LogFileName");
transceiverPid = vfork();
assert(transceiverPid>=0);
if (transceiverPid==0) {
execl(TRXPath,"transceiver",TRXLogLevel,TRXLogFileName,NULL);
LOG(ERROR) << "cannot start transceiver";
_exit(0);
}
}
// Start the SIP interface.
gSIPInterface.start();
// Start the transceiver interface.
gTRX.start();
// Set up the interface to the radio.
// Get a handle to the C0 transceiver interface.
ARFCNManager* radio = gTRX.ARFCN(0);
// Tuning.
// Make sure its off for tuning.
radio->powerOff();
// Set TSC same as BSC everywhere.
radio->setTSC(gBTS.BCC());
// Tune.
radio->tune(gConfig.getNum("GSM.ARFCN"));
// C-V on C0T0
radio->setSlot(0,5);
// Turn on and power up.
radio->powerOn();
radio->setPower(gConfig.getNum("GSM.PowerAttenDB"));
// set up a combination V beacon set
// SCH
SCHL1FEC SCH;
SCH.downstream(radio);
SCH.open();
// FCCH
FCCHL1FEC FCCH;
FCCH.downstream(radio);
FCCH.open();
// BCCH
BCCHL1FEC BCCH;
BCCH.downstream(radio);
BCCH.open();
// RACH
RACHL1FEC RACH(gRACHC5Mapping);
RACH.downstream(radio);
RACH.open();
// CCCHs
CCCHLogicalChannel CCCH0(gCCCH_0Mapping);
CCCH0.downstream(radio);
CCCH0.open();
CCCHLogicalChannel CCCH1(gCCCH_1Mapping);
CCCH1.downstream(radio);
CCCH1.open();
CCCHLogicalChannel CCCH2(gCCCH_2Mapping);
CCCH2.downstream(radio);
CCCH2.open();
// use CCCHs as AGCHs
gBTS.addAGCH(&CCCH0);
gBTS.addAGCH(&CCCH1);
gBTS.addAGCH(&CCCH2);
// C-V C0T0 SDCCHs
SDCCHLogicalChannel SDCCH[4] = {
SDCCHLogicalChannel(0,gSDCCH_4_0),
SDCCHLogicalChannel(0,gSDCCH_4_1),
SDCCHLogicalChannel(0,gSDCCH_4_2),
SDCCHLogicalChannel(0,gSDCCH_4_3)
};
Thread SDCCHControlThread[4];
for (int i=0; i<4; i++) {
SDCCH[i].downstream(radio);
SDCCHControlThread[i].start((void*(*)(void*))Control::DCCHDispatcher,&SDCCH[i]);
SDCCH[i].open();
gBTS.addSDCCH(&SDCCH[i]);
//.........这里部分代码省略.........
示例4: main
int main(int argc, char *argv[])
{
// TODO: Properly parse and handle any arguments
if (argc > 1) {
for (int argi = 0; argi < argc; argi++) {
if (!strcmp(argv[argi], "--version") ||
!strcmp(argv[argi], "-v")) {
cout << gVersionString << endl;
}
}
return 0;
}
createStats();
gReports.incr("OpenBTS.Starts");
int sock = socket(AF_UNIX,SOCK_DGRAM,0);
if (sock<0) {
perror("creating CLI datagram socket");
LOG(ALERT) << "cannot create socket for CLI";
gReports.incr("OpenBTS.Exit.CLI.Socket");
exit(1);
}
try {
srandom(time(NULL));
gConfig.setUpdateHook(purgeConfig);
gLogInit("openbts",gConfig.getStr("Log.Level").c_str());
LOG(ALERT) << "OpenBTS starting, ver " << VERSION << " build date " << __DATE__;
COUT("\n\n" << gOpenBTSWelcome << "\n");
gTMSITable.open(gConfig.getStr("Control.Reporting.TMSITable").c_str());
gTransactionTable.init(gConfig.getStr("Control.Reporting.TransactionTable").c_str());
gPhysStatus.open(gConfig.getStr("Control.Reporting.PhysStatusTable").c_str());
gBTS.init();
gSubscriberRegistry.init();
gParser.addCommands();
COUT("\nStarting the system...");
// is the radio running?
// Start the transceiver interface.
LOG(INFO) << "checking transceiver";
//gTRX.ARFCN(0)->powerOn();
//sleep(gConfig.getNum("TRX.Timeout.Start",2));
bool haveTRX = gTRX.ARFCN(0)->powerOn(false);
Thread transceiverThread;
if (!haveTRX) {
transceiverThread.start((void*(*)(void*)) startTransceiver, NULL);
// sleep to let the FPGA code load
// TODO: we should be "pinging" the radio instead of sleeping
sleep(5);
} else {
LOG(NOTICE) << "transceiver already running";
}
// Start the SIP interface.
gSIPInterface.start();
//
// Configure the radio.
//
gTRX.start();
// Set up the interface to the radio.
// Get a handle to the C0 transceiver interface.
ARFCNManager* C0radio = gTRX.ARFCN(0);
// Tuning.
// Make sure its off for tuning.
//C0radio->powerOff();
// Get the ARFCN list.
unsigned C0 = gConfig.getNum("GSM.Radio.C0");
unsigned numARFCNs = gConfig.getNum("GSM.Radio.ARFCNs");
for (unsigned i=0; i<numARFCNs; i++) {
// Tune the radios.
unsigned ARFCN = C0 + i*2;
LOG(INFO) << "tuning TRX " << i << " to ARFCN " << ARFCN;
ARFCNManager* radio = gTRX.ARFCN(i);
radio->tune(ARFCN);
}
// Send either TSC or full BSIC depending on radio need
if (gConfig.getBool("GSM.Radio.NeedBSIC")) {
// Send BSIC to
C0radio->setBSIC(gBTS.BSIC());
} else {
// Set TSC same as BCC everywhere.
C0radio->setTSC(gBTS.BCC());
}
// Set maximum expected delay spread.
C0radio->setMaxDelay(gConfig.getNum("GSM.Radio.MaxExpectedDelaySpread"));
//.........这里部分代码省略.........