[MERGED] 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
Tue Mar 28 14:29:58 UTC 2017


Alexander Chemeris has submitted this change and it was merged.

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


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(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Harald Welte: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 2de1816..d57f8b4 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 04c4757..4f2c13e 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: merged
Gerrit-Change-Id: I3d68cbdab8fb504d7f155029654a576d318a201e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: Alexander Chemeris <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <tom at tsou.cc>



More information about the gerrit-log mailing list