diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-06-13 19:32:15 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-06-13 23:46:27 +0200 |
commit | 2407314f2e7cec64b5430d29a163fc23a10f6daf (patch) | |
tree | 83619cf5984da600acae3f0f2870ae0a64f4fc0d /Transceiver52M/device/radioDevice.h | |
parent | ff4418539cbd19322026e5cfdb01e50d2aae4257 (diff) |
move set_antennas() from UHD to generic radioDevice base class
Change-Id: I806143e9db21f0be4dcc6a376b3a630be7aeb3ba
Diffstat (limited to 'Transceiver52M/device/radioDevice.h')
-rw-r--r-- | Transceiver52M/device/radioDevice.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Transceiver52M/device/radioDevice.h b/Transceiver52M/device/radioDevice.h index c5cd461..469b574 100644 --- a/Transceiver52M/device/radioDevice.h +++ b/Transceiver52M/device/radioDevice.h @@ -19,6 +19,7 @@ #include <vector> #include "GSMCommon.h" +#include "Logger.h" extern "C" { #include "config_defs.h" @@ -163,6 +164,34 @@ class RadioDevice { virtual double numberRead()=0; virtual double numberWritten()=0; + std::vector<std::string> tx_paths, rx_paths; + bool set_antennas() { + unsigned int i; + + for (i = 0; i < tx_paths.size(); i++) { + if (tx_paths[i] == "") + continue; + LOG(DEBUG) << "Configuring channel " << i << " with antenna " << tx_paths[i]; + if (!setTxAntenna(tx_paths[i], i)) { + LOG(ALERT) << "Failed configuring channel " << i << " with antenna " << tx_paths[i]; + return false; + } + } + + for (i = 0; i < rx_paths.size(); i++) { + if (rx_paths[i] == "") + continue; + LOG(DEBUG) << "Configuring channel " << i << " with antenna " << rx_paths[i]; + if (!setRxAntenna(rx_paths[i], i)) { + LOG(ALERT) << "Failed configuring channel " << i << " with antenna " << rx_paths[i]; + return false; + } + } + LOG(INFO) << "Antennas configured successfully"; + return true; + } + + }; #endif |