[PATCH] osmo-trx[master]: sigProcLib: Add operator<< to print CorrType to a string.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Alexander Chemeris gerrit-no-reply at lists.osmocom.org
Wed Mar 22 18:44:19 UTC 2017


Review at  https://gerrit.osmocom.org/2150

sigProcLib: Add operator<< to print CorrType to a string.

Change-Id: I3d68cbdab8fb504d7f155029654a576d318a201e
---
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 25 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/50/2150/1

diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index b531fea..5995845 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -2166,3 +2166,26 @@
   sigProcLibDestroy();
   return false;
 }
+
+std::string corrTypeToString(CorrType corr) {
+  switch (corr) {
+  case OFF:
+    return "OFF";
+  case TSC:
+    return "TSC";
+  case RACH:
+    return "RACH";
+  case EDGE:
+    return "EDGE";
+  case IDLE:
+    return "IDLE";
+  default:
+    return "unknown";
+  }
+}
+
+std::ostream& operator<<(std::ostream& os, CorrType corr)
+{
+  os << corrTypeToString(corr);
+  return os;
+}
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index bea9c4a..0f40c1e 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -41,6 +41,8 @@
   EDGE,        ///< timeslot should contain an EDGE burst
   IDLE         ///< timeslot is an idle (or dummy) burst
 };
+std::string corrTypeToString(CorrType corr);
+std::ostream& operator<<(std::ostream& os, CorrType corr);
 
 enum SignalError {
   SIGERR_NONE,

-- 
To view, visit https://gerrit.osmocom.org/2150
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d68cbdab8fb504d7f155029654a576d318a201e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <Alexander.Chemeris at gmail.com>



More information about the gerrit-log mailing list