summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/host/trxcon/src/trx_if.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c
index a9a6c96f..92b9d12c 100644
--- a/src/host/trxcon/src/trx_if.c
+++ b/src/host/trxcon/src/trx_if.c
@@ -768,6 +768,8 @@ void trx_if_flush_ctrl(struct trx_instance *trx)
void trx_if_close(struct trx_instance *trx)
{
+ static const char cmd_poweroff[] = "CMD POWEROFF";
+
/* May be unallocated due to init error */
if (!trx)
return;
@@ -780,6 +782,10 @@ void trx_if_close(struct trx_instance *trx)
/* Flush CTRL message list */
trx_if_flush_ctrl(trx);
+ /* Power off if the transceiver is up */
+ if (trx->powered_up && trx->trx_ofd_ctrl.fd >= 0)
+ send(trx->trx_ofd_ctrl.fd, &cmd_poweroff[0], sizeof(cmd_poweroff), 0);
+
/* Close sockets */
trx_udp_close(&trx->trx_ofd_ctrl);
trx_udp_close(&trx->trx_ofd_data);