aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/osmo-trx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Transceiver52M/osmo-trx.cpp')
-rw-r--r--Transceiver52M/osmo-trx.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 1c40fcf..d01a4cf 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -55,6 +55,7 @@ extern "C" {
#include "convert.h"
#include "trx_vty.h"
#include "debug.h"
+#include "osmo_signal.h"
}
#define DEFAULT_CONFIG_FILE "osmo-trx.cfg"
@@ -112,6 +113,20 @@ RadioInterface *makeRadioInterface(struct trx_ctx *trx,
return radio;
}
+/* Callback function to be called every time we receive a signal from TRANSC */
+static int transc_sig_cb(unsigned int subsys, unsigned int signal,
+ void *handler_data, void *signal_data)
+{
+ switch (signal) {
+ case S_TRANSC_STOP_REQUIRED:
+ gshutdown = true;
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
/* Create transceiver core
* The multi-threaded modem core operates at multiples of the GSM rate of
* 270.8333 ksps and consists of GSM specific modulation, demodulation,
@@ -132,6 +147,8 @@ int makeTransceiver(struct trx_ctx *trx, RadioInterface *radio)
return -1;
}
+ transceiver->setSignalHandler(transc_sig_cb);
+
for (size_t i = 0; i < trx->cfg.num_chans; i++) {
fifo = radio->receiveFIFO(i);
if (fifo && transceiver->receiveFIFO(fifo, i))