| 69 | |
| 70 | |
| 71 | int main(int argc, char *argv[]) |
| 72 | { |
| 73 | try { |
| 74 | GSM::GSMBand band = (GSM::GSMBand)gConfig.getNum("GSM.Radio.Band"); |
| 75 | SpectrumMap spectrumMap(gConfig.getStr("PowerScanner.DBPath").c_str()); |
| 76 | int startARFCN, stopARFCN; |
| 77 | switch (band) { |
| 78 | case GSM::GSM850: startARFCN=130; stopARFCN=251; break; |
| 79 | case GSM::EGSM900: startARFCN=0; stopARFCN=124; break; |
| 80 | case GSM::DCS1800: startARFCN=512; stopARFCN=885; break; |
| 81 | case GSM::PCS1900: startARFCN=512; stopARFCN=810; break; |
| 82 | default: |
| 83 | LOG(ALERT) << "Unsupported GSM Band specified (config key GSM.Radio.Band). Exiting..."; |
| 84 | exit(-1); |
| 85 | } |
| 86 | |
| 87 | RAD1Device *rad = new RAD1Device(1625.0e3/6.0); |
| 88 | rad->make(false, 0); |
| 89 | rad->start(); |
| 90 | TIMESTAMP timestamp = 19000; |
| 91 | |
| 92 | cout << endl << "Scanning Uplink" << endl; |
| 93 | scanDirection(rad, timestamp, band, startARFCN, stopARFCN, &GSM::uplinkFreqKHz, SpectrumMap::LinkDirection::Up, spectrumMap); |
| 94 | cout << endl << "Scanning Downlink" << endl; |
| 95 | scanDirection(rad, timestamp, band, startARFCN, stopARFCN, &GSM::downlinkFreqKHz, SpectrumMap::LinkDirection::Down, spectrumMap); |
| 96 | |
| 97 | } catch (ConfigurationTableKeyNotFound e) { |
| 98 | cout << "Required configuration parameter " << e.key() << " not defined, exiting."; |
| 99 | return -1; |
| 100 | } |
| 101 | |
| 102 | return 0; |
| 103 | } |
| 104 | |
| 105 | int scanDirection(RAD1Device *rad, TIMESTAMP ×tamp, GSM::GSMBand band, int startARFCN, int stopARFCN, |
| 106 | FrequencyConverter arfcnToFreqKHz, SpectrumMap::LinkDirection linkDir, SpectrumMap &spectrumMap) |
nothing calls this directly
no test coverage detected