lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

March 2026

  • 1 participants
  • 1933 discussions
[M] Change in osmo-trx[master]: transceiver: split control command handling from socket I/O
by Timur Davydov 16 Mar '26

16 Mar '26
Timur Davydov has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/42410?usp=email ) Change subject: transceiver: split control command handling from socket I/O ...................................................................... transceiver: split control command handling from socket I/O - move control command parsing/response generation into ctrl_cmd_handle() - keep ctrl_sock_handle_rx() focused on socket read/write - make command input read-only where applicable - switch response formatting from sprintf() to snprintf() Change-Id: I5413aa511e951522270c75635e89448395fc429e --- M Transceiver52M/Transceiver.cpp M Transceiver52M/Transceiver.h 2 files changed, 67 insertions(+), 54 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/10/42410/1 diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index f5ddd9b..928a30f 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -828,8 +828,8 @@ * @param params pointer to arguments, or NULL * @return true if command matches, otherwise false */ -static bool match_cmd(char *buf, - const char *cmd, char **params) +static bool match_cmd(const char *buf, + const char *cmd, const char **params) { size_t cmd_len = strlen(cmd); @@ -894,28 +894,10 @@ return -1; } -int Transceiver::ctrl_sock_handle_rx(int chan) +int Transceiver::ctrl_cmd_handle(int chan, const char *buffer, char *response, size_t response_size) { - ctrl_msg cmd_received; - ctrl_msg cmd_to_send; - char *buffer = cmd_received.data; - char *response = cmd_to_send.data; - char *command, *params; - int msgLen; - ctrl_sock_state& s = mCtrlSockets[chan]; - - /* Attempt to read from control socket */ - msgLen = read(s.conn_bfd.fd, buffer, sizeof(cmd_received.data)-1); - if (msgLen < 0 && errno == EAGAIN) - return 0; /* Try again later */ - if (msgLen <= 0) { - LOGCHAN(chan, DTRXCTRL, NOTICE) << "mCtrlSockets read(" << s.conn_bfd.fd << ") failed: " << msgLen; - return -EIO; - } - - - /* Zero-terminate received string */ - buffer[msgLen] = '\0'; + const char *command; + const char *params; /* Verify a command signature */ if (strncmp(buffer, "CMD ", 4)) { @@ -929,12 +911,12 @@ if (match_cmd(command, "POWEROFF", NULL)) { stop(); - sprintf(response,"RSP POWEROFF 0"); + snprintf(response, response_size, "RSP POWEROFF 0"); } else if (match_cmd(command, "POWERON", NULL)) { if (!start()) { - sprintf(response,"RSP POWERON 1"); + snprintf(response, response_size, "RSP POWERON 1"); } else { - sprintf(response,"RSP POWERON 0"); + snprintf(response, response_size, "RSP POWERON 0"); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) mHandover[i][j] = false; @@ -944,62 +926,62 @@ unsigned ts = 0, ss = 0; sscanf(params, "%u %u", &ts, &ss); if (ts > 7 || ss > 7) { - sprintf(response, "RSP HANDOVER 1 %u %u", ts, ss); + snprintf(response, response_size, "RSP HANDOVER 1 %u %u", ts, ss); } else { mHandover[ts][ss] = true; - sprintf(response, "RSP HANDOVER 0 %u %u", ts, ss); + snprintf(response, response_size, "RSP HANDOVER 0 %u %u", ts, ss); } } else if (match_cmd(command, "NOHANDOVER", &params)) { unsigned ts = 0, ss = 0; sscanf(params, "%u %u", &ts, &ss); if (ts > 7 || ss > 7) { - sprintf(response, "RSP NOHANDOVER 1 %u %u", ts, ss); + snprintf(response, response_size, "RSP NOHANDOVER 1 %u %u", ts, ss); } else { mHandover[ts][ss] = false; - sprintf(response, "RSP NOHANDOVER 0 %u %u", ts, ss); + snprintf(response, response_size, "RSP NOHANDOVER 0 %u %u", ts, ss); } } else if (match_cmd(command, "SETMAXDLY", &params)) { //set expected maximum time-of-arrival for Access Bursts int maxDelay; sscanf(params, "%d", &maxDelay); mMaxExpectedDelayAB = maxDelay; // 1 GSM symbol is approx. 1 km - sprintf(response,"RSP SETMAXDLY 0 %d",maxDelay); + snprintf(response, response_size,"RSP SETMAXDLY 0 %d",maxDelay); } else if (match_cmd(command, "SETMAXDLYNB", &params)) { //set expected maximum time-of-arrival for Normal Bursts int maxDelay; sscanf(params, "%d", &maxDelay); mMaxExpectedDelayNB = maxDelay; // 1 GSM symbol is approx. 1 km - sprintf(response,"RSP SETMAXDLYNB 0 %d",maxDelay); + snprintf(response, response_size,"RSP SETMAXDLYNB 0 %d",maxDelay); } else if (match_cmd(command, "SETRXGAIN", &params)) { int newGain; sscanf(params, "%d", &newGain); newGain = mRadioInterface->setRxGain(newGain, chan); - sprintf(response,"RSP SETRXGAIN 0 %d",newGain); + snprintf(response, response_size,"RSP SETRXGAIN 0 %d",newGain); } else if (match_cmd(command, "NOISELEV", NULL)) { if (mOn) { float lev = mStates[chan].mNoiseLev; - sprintf(response,"RSP NOISELEV 0 %d", + snprintf(response, response_size,"RSP NOISELEV 0 %d", (int) round(20.0 * log10(rxFullScale / lev))); } else { - sprintf(response,"RSP NOISELEV 1 0"); + snprintf(response, response_size,"RSP NOISELEV 1 0"); } } else if (match_cmd(command, "SETPOWER", &params)) { int power; sscanf(params, "%d", &power); power = mRadioInterface->setPowerAttenuation(power, chan); mStates[chan].mPower = power; - sprintf(response, "RSP SETPOWER 0 %d", power); + snprintf(response, response_size, "RSP SETPOWER 0 %d", power); } else if (match_cmd(command, "ADJPOWER", &params)) { int power, step; sscanf(params, "%d", &step); power = mStates[chan].mPower + step; power = mRadioInterface->setPowerAttenuation(power, chan); mStates[chan].mPower = power; - sprintf(response, "RSP ADJPOWER 0 %d", power); -} else if (match_cmd(command, "NOMTXPOWER", NULL)) { + snprintf(response, response_size, "RSP ADJPOWER 0 %d", power); + } else if (match_cmd(command, "NOMTXPOWER", NULL)) { int power = mRadioInterface->getNominalTxPower(chan); - sprintf(response, "RSP NOMTXPOWER 0 %d", power); + snprintf(response, response_size, "RSP NOMTXPOWER 0 %d", power); } else if (match_cmd(command, "RXTUNE", &params)) { // tune receiver int freqKhz; @@ -1007,10 +989,10 @@ mRxFreq = (freqKhz + cfg->freq_offset_khz) * 1e3; if (!mRadioInterface->tuneRx(mRxFreq, chan)) { LOGCHAN(chan, DTRXCTRL, FATAL) << "RX failed to tune"; - sprintf(response,"RSP RXTUNE 1 %d",freqKhz); + snprintf(response, response_size, "RSP RXTUNE 1 %d", freqKhz); } else - sprintf(response,"RSP RXTUNE 0 %d",freqKhz); + snprintf(response, response_size, "RSP RXTUNE 0 %d", freqKhz); } else if (match_cmd(command, "TXTUNE", &params)) { // tune txmtr int freqKhz; @@ -1018,20 +1000,20 @@ mTxFreq = (freqKhz + cfg->freq_offset_khz) * 1e3; if (!mRadioInterface->tuneTx(mTxFreq, chan)) { LOGCHAN(chan, DTRXCTRL, FATAL) << "TX failed to tune"; - sprintf(response,"RSP TXTUNE 1 %d",freqKhz); + snprintf(response, response_size, "RSP TXTUNE 1 %d", freqKhz); } else - sprintf(response,"RSP TXTUNE 0 %d",freqKhz); + snprintf(response, response_size, "RSP TXTUNE 0 %d", freqKhz); } else if (match_cmd(command, "SETTSC", &params)) { // set TSC unsigned TSC; sscanf(params, "%u", &TSC); if (TSC > 7) { - sprintf(response, "RSP SETTSC 1 %d", TSC); + snprintf(response, response_size, "RSP SETTSC 1 %d", TSC); } else { LOGC(DTRXCTRL, NOTICE) << "Changing TSC from " << mTSC << " to " << TSC; mTSC = TSC; - sprintf(response,"RSP SETTSC 0 %d", TSC); + snprintf(response, response_size, "RSP SETTSC 0 %d", TSC); } } else if (match_cmd(command, "SETSLOT", &params)) { // set slot type @@ -1040,12 +1022,12 @@ sscanf(params, "%d %d", &timeslot, &corrCode); if ((timeslot < 0) || (timeslot > 7)) { LOGCHAN(chan, DTRXCTRL, NOTICE) << "bogus message on control interface"; - sprintf(response,"RSP SETSLOT 1 %d %d",timeslot,corrCode); - return 0; + snprintf(response, response_size, "RSP SETSLOT 1 %d %d",timeslot,corrCode); + return -EINVAL; } mStates[chan].chanType[timeslot] = (ChannelCombination) corrCode; setModulus(timeslot, chan); - sprintf(response,"RSP SETSLOT 0 %d %d",timeslot,corrCode); + snprintf(response, response_size,"RSP SETSLOT 0 %d %d",timeslot,corrCode); } else if (match_cmd(command, "SETFORMAT", &params)) { // set TRXD protocol version unsigned version_recv; @@ -1054,30 +1036,60 @@ if (version_recv > TRX_DATA_FORMAT_VER) { LOGCHAN(chan, DTRXCTRL, INFO) << "rejecting TRXD version " << version_recv << " in favor of " << TRX_DATA_FORMAT_VER; - sprintf(response, "RSP SETFORMAT %u %u", TRX_DATA_FORMAT_VER, version_recv); + snprintf(response, response_size, "RSP SETFORMAT %u %u", TRX_DATA_FORMAT_VER, version_recv); } else { LOGCHAN(chan, DTRXCTRL, NOTICE) << "switching to TRXD version " << version_recv; mVersionTRXD[chan] = version_recv; - sprintf(response, "RSP SETFORMAT %u %u", version_recv, version_recv); + snprintf(response, response_size, "RSP SETFORMAT %u %u", version_recv, version_recv); } } else if (match_cmd(command, "RFMUTE", &params)) { // (Un)mute RF TX and RX unsigned mute; sscanf(params, "%u", &mute); mStates[chan].mMuted = mute ? true : false; - sprintf(response, "RSP RFMUTE 0 %u", mute); + snprintf(response, response_size, "RSP RFMUTE 0 %u", mute); } else if (match_cmd(command, "_SETBURSTTODISKMASK", &params)) { // debug command! may change or disappear without notice // set a mask which bursts to dump to disk int mask; sscanf(params, "%d", &mask); mWriteBurstToDiskMask = mask; - sprintf(response,"RSP _SETBURSTTODISKMASK 0 %d",mask); + snprintf(response, response_size, "RSP _SETBURSTTODISKMASK 0 %d", mask); } else { LOGCHAN(chan, DTRXCTRL, NOTICE) << "bogus command " << command << " on control interface."; - sprintf(response,"RSP ERR 1"); + snprintf(response, response_size, "RSP ERR 1"); } + return 0; +} + +int Transceiver::ctrl_sock_handle_rx(int chan) +{ + int rc; + ctrl_msg cmd_received; + ctrl_msg cmd_to_send; + char *buffer = cmd_received.data; + char *response = cmd_to_send.data; + const size_t response_size = sizeof(cmd_to_send.data); + int msgLen; + ctrl_sock_state& s = mCtrlSockets[chan]; + + /* Attempt to read from control socket */ + msgLen = read(s.conn_bfd.fd, buffer, sizeof(cmd_received.data)-1); + if (msgLen < 0 && errno == EAGAIN) + return 0; /* Try again later */ + if (msgLen <= 0) { + LOGCHAN(chan, DTRXCTRL, NOTICE) << "mCtrlSockets read(" << s.conn_bfd.fd << ") failed: " << msgLen; + return -EIO; + } + + /* Zero-terminate received string */ + buffer[msgLen] = '\0'; + + rc = ctrl_cmd_handle(chan, buffer, response, response_size); + if (rc < 0) + return rc == -EINVAL ? 0 : rc; /* Ignore invalid values, but report other errors */ + LOGCHAN(chan, DTRXCTRL, INFO) << "response is '" << response << "'"; transceiver->ctrl_sock_send(cmd_to_send, chan); return 0; diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index babe420..f25fd0b 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -147,7 +147,7 @@ LOOPBACK ///< similar go VII, used in loopback testing } ChannelCombination; -private: +protected: size_t mChans; struct ctrl_msg { char data[101]; @@ -217,6 +217,7 @@ int ctrl_sock_write(int chan); void ctrl_sock_send(ctrl_msg& m, int chan); /** drive handling of control messages from GSM core */ + int ctrl_cmd_handle(int chan, const char* buffer, char *response, size_t response_size); int ctrl_sock_handle_rx(int chan); -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/42410?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I5413aa511e951522270c75635e89448395fc429e Gerrit-Change-Number: 42410 Gerrit-PatchSet: 1 Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
1 0
0 0
[L] Change in osmo-trx[master]: device/websdr: add WebSDR transceiver backend and build target
by Timur Davydov 16 Mar '26

16 Mar '26
Timur Davydov has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/42411?usp=email ) Change subject: device/websdr: add WebSDR transceiver backend and build target ...................................................................... device/websdr: add WebSDR transceiver backend and build target - add libosmo-trx-websdr library and pkg-config file - integrate WebSDR device into the autotools build system - update .gitignore for wasm and pkg-config artifacts Change-Id: Ia0d340c323c2eea28fbe82601ba0af7cfbd68f6d --- M .gitignore M Transceiver52M/Makefile.am M Transceiver52M/device/Makefile.am A Transceiver52M/device/websdr/Makefile.am A Transceiver52M/device/websdr/TransceiverWebSdr.cpp A Transceiver52M/device/websdr/TransceiverWebSdr.h A Transceiver52M/device/websdr/libosmo-trx-websdr.pc.in A Transceiver52M/device/websdr/osmo-trx-websdr.cpp A Transceiver52M/device/websdr/osmo-trx-websdr.h A Transceiver52M/device/websdr/radioInterfaceWebSdr.cpp A Transceiver52M/device/websdr/radioInterfaceWebSdr.h M Transceiver52M/radioInterface.h M configure.ac 13 files changed, 852 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/11/42411/1 diff --git a/.gitignore b/.gitignore index fc567db..1995586 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ *.o *.lo *.la +*.pc +*.wasm +*.out.js Transceiver52M/osmo-trx-uhd Transceiver52M/osmo-trx-usrp1 Transceiver52M/osmo-trx-lms @@ -35,6 +38,7 @@ # automake/autoconf *.in +!*.pc.in .deps .libs .dirstamp diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index 74152b3..ac410f1 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -201,3 +201,15 @@ $(COMMON_LDADD) osmo_trx_ipc_CPPFLAGS = $(AM_CPPFLAGS) endif + +if DEVICE_WEBSDR +include_HEADERS = device/websdr/osmo-trx-websdr.h +lib_LTLIBRARIES = libosmo-trx-websdr.la +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = device/websdr/libosmo-trx-websdr.pc +libosmo_trx_websdr_la_SOURCES = +libosmo_trx_websdr_la_LIBADD = \ + $(builddir)/device/websdr/libdevice.la \ + $(COMMON_LDADD) + $(NULL) +endif diff --git a/Transceiver52M/device/Makefile.am b/Transceiver52M/device/Makefile.am index b5a5cec..62a013e 100644 --- a/Transceiver52M/device/Makefile.am +++ b/Transceiver52M/device/Makefile.am @@ -21,3 +21,7 @@ if DEVICE_BLADE SUBDIRS += bladerf endif + +if DEVICE_WEBSDR +SUBDIRS += websdr +endif diff --git a/Transceiver52M/device/websdr/Makefile.am b/Transceiver52M/device/websdr/Makefile.am new file mode 100644 index 0000000..422b16f --- /dev/null +++ b/Transceiver52M/device/websdr/Makefile.am @@ -0,0 +1,14 @@ +include $(top_srcdir)/Makefile.common + +AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I${srcdir}/../common -I${srcdir}/../.. -I${srcdir}/../../arch/common +AM_CXXFLAGS = -lpthread $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(UHD_CFLAGS) + +noinst_HEADERS = osmo-trx-websdr.h + +noinst_LTLIBRARIES = libdevice.la + +libdevice_la_SOURCES = \ + radioInterfaceWebSdr.cpp \ + TransceiverWebSdr.cpp \ + osmo-trx-websdr.cpp \ + $(NULL) \ No newline at end of file diff --git a/Transceiver52M/device/websdr/TransceiverWebSdr.cpp b/Transceiver52M/device/websdr/TransceiverWebSdr.cpp new file mode 100644 index 0000000..0518de4 --- /dev/null +++ b/Transceiver52M/device/websdr/TransceiverWebSdr.cpp @@ -0,0 +1,322 @@ +/* + * WebSDR radio transceiver implementation + * + * Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + * Copyright 2026 Wavelet Lab <info(a)wavelet-lab.com> + * + * SPDX-License-Identifier: GPL-3.0+ + * + * This software is distributed under the terms of the GNU Public License. + * See the COPYING file in the main directory for details. + * + * This use of this software may be subject to additional restrictions. + * See the LEGAL file in the main directory for details. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "TransceiverWebSdr.h" + +#include <fstream> +#include <grgsm_vitac/grgsm_vitac.h> + +extern "C" { +#include "proto_trxd.h" +#include "osmocom/core/bits.h" +} + +using namespace GSM; + +enum { + RET_OK = 0, + RET_OK_UPDSTAT = 1, + RET_FAILED = -1 +}; + +TransceiverWebSdr::TransceiverWebSdr(const struct trx_cfg *cfg, + GSM::Time wTransmitLatency, + RadioInterfaceWebSdr *wRadioInterface) + : Transceiver(cfg, wTransmitLatency, wRadioInterface) +{ +} + +/* + * Initialize transceiver + * + * Start or restart the control loop. Any further control is handled through the + * socket API. Randomize the central radio clock set the downlink burst + * counters. Note that the clock will not update until the radio starts, but we + * are still expected to report clock indications through control channel + * activity. + */ +bool TransceiverWebSdr::init() +{ + if (!mChans) { + LOG(FATAL) << "No channels assigned"; + return false; + } + + if (!sigProcLibSetup()) { + LOG(FATAL) << "Failed to initialize signal processing library"; + return false; + } + + initvita(); + + /* Filler table retransmissions - support only on channel 0 */ + if (cfg->filler == FILLER_DUMMY) + mStates[0].mRetrans = true; + + /* Randomize the central clock */ + GSM::Time startTime(random() % gHyperframe, 0); + mRadioInterfaceWebSdr->getClock()->set(startTime); + mTransmitDeadlineClock = startTime; + mLastClockUpdateTime = startTime; + mLatencyUpdateTime = startTime; + + return true; +} + +bool TransceiverWebSdr::start() +{ + if (mOn) { + LOG(ERR) << "Transceiver already running"; + return true; + } + + LOG(NOTICE) << "Starting the transceiver"; + + GSM::Time time = mRadioInterfaceWebSdr->getClock()->get(); + mTransmitDeadlineClock = time; + mLastClockUpdateTime = time; + mLatencyUpdateTime = time; + + if (!mRadioInterfaceWebSdr->start()) { + LOG(FATAL) << "Device failed to start"; + return false; + } + + mForceClockInterface = true; + mOn = true; + return true; +} + +void TransceiverWebSdr::stop() +{ + if (!mOn) + return; + + LOG(NOTICE) << "Stopping the transceiver"; + LOG(INFO) << "Stopping the device"; + mRadioInterfaceWebSdr->stop(); + + mOn = false; + LOG(NOTICE) << "Transceiver stopped"; +} + +int TransceiverWebSdr::driveReceiveRadioShortVector(short **buffers, int samples, int underrun, + TIMESTAMP ts, unsigned samples_skipped) +{ + int rc; + + rc = mRadioInterfaceWebSdr->fillPullBuffer(buffers, samples, underrun, ts); + if (rc) + return rc; + + rc = mRadioInterfaceWebSdr->driveReceiveRadioWithBuffer(samples_skipped); + if (rc) + return rc; + + if (mForceClockInterface || mTransmitDeadlineClock > mLastClockUpdateTime + GSM::Time(216, 0)) { + if (mForceClockInterface) + LOGC(DTRXCLK, NOTICE) << "Sending CLOCK indications"; + mForceClockInterface = false; + if (on_write_clock((unsigned long long)(mTransmitDeadlineClock.FN() + 2))) { + mLastClockUpdateTime = mTransmitDeadlineClock; + } else { + return false; + } + } + return true; +} + +int TransceiverWebSdr::driveReceiveFIFOBurst(size_t chan, char *buf, int maxLen) +{ + struct trx_ul_burst_ind bi; + int rc; + + if ((rc = pullRadioVector(chan, &bi)) < 0) { + if (rc == -EAGAIN) + return 0; + if (rc == -ENOENT) { /* timeslot off, continue processing */ + LOGCHAN(chan, DTRXDUL, DEBUG) << unsigned(bi.tn) << ":" << bi.fn << " timeslot is off"; + return rc; + } + return rc; /* other errors: we want to stop the process */ + } + + if (!bi.idle) + logRxBurst(chan, &bi); + + switch (mVersionTRXD[chan]) { + case 0: + return trxd_prepare_burst_ind_v0(&bi, buf, maxLen); + case 1: + return trxd_prepare_burst_ind_v1(&bi, buf, maxLen); + default: + //OSMO_ASSERT(false); + return -EFAULT; + } +} + +void TransceiverWebSdr::driveTxFIFO() +{ + RadioClock *radioClock = (mRadioInterfaceWebSdr->getClock()); + + if (mOn) { + LOGC(DTRXCLK, DEBUG) << "radio clock " << radioClock->get(); + while (radioClock->get() + mTransmitLatency > mTransmitDeadlineClock) { + // time to push burst to transmit FIFO + pushRadioVector(mTransmitDeadlineClock); + mTransmitDeadlineClock.incTN(); + } + } +} + +bool TransceiverWebSdr::driveTxPriorityQueue(size_t chan, char *buffer, int msgLen) +{ + int res = post_tx_burst(chan, buffer, msgLen); + if (res == RET_OK_UPDSTAT) { + return true; + } else if (res == RET_OK) { + return true; + } else { + return false; + } +} + +int TransceiverWebSdr::processCommand(int chan, const char *buffer, char *response, size_t response_size) +{ + return ctrl_cmd_handle(chan, buffer, response, response_size); +} + +bool TransceiverWebSdr::on_write_clock(unsigned long long clock) +{ + LOG(ALERT) << "IND CLOCK " << clock; + mIndClockValid = true; + mIndClock = clock; + + return true; +} + + +bool TransceiverWebSdr::peekClock(unsigned *out) +{ + bool res = mIndClockValid; + *out = mIndClock; + mIndClockValid = false; + return res; +} + +int TransceiverWebSdr::post_tx_burst(size_t chan, char *buffer, int msgLen) +{ + int burstLen; + struct trxd_hdr_v01_dl *dl; + uint32_t fn; + uint8_t tn; + int res = RET_OK; + + switch (msgLen) { + case sizeof(*dl) + gSlotLen: /* GSM burst */ + burstLen = gSlotLen; + break; + case sizeof(*dl) + EDGE_BURST_NBITS: /* EDGE burst */ + if (cfg->tx_sps != 4) { + LOGCHAN(chan, DTRXDDL, ERROR) << "EDGE burst received but SPS is set to " << cfg->tx_sps; + return RET_FAILED; + } + burstLen = EDGE_BURST_NBITS; + break; + default: + LOGCHAN(chan, DTRXDDL, ERROR) << "badly formatted packet on GSM->TRX interface (len=" << msgLen << ")"; + return RET_FAILED; + } + + dl = (struct trxd_hdr_v01_dl *)buffer; + + /* Convert TDMA FN to the host endianness */ + fn = osmo_load32be(&dl->common.fn); + tn = dl->common.tn; + + /* Make sure we support the received header format */ + switch (dl->common.version) { + case 0: + /* Version 1 has the same format */ + case 1: + break; + default: + LOGCHAN(chan, DTRXDDL, ERROR) + << "Rx TRXD message with unknown header version " << unsigned(dl->common.version); + return RET_FAILED; + } + + LOGCHAN(chan, DTRXDDL, DEBUG) << "Rx TRXD message (hdr_ver=" << unsigned(dl->common.version) << "): fn=" << fn + << ", tn=" << unsigned(tn) << ", burst_len=" << burstLen; + + TransceiverState *state = &mStates[chan]; + GSM::Time currTime = GSM::Time(fn, tn); + + /* Verify proper FN order in DL stream */ + if (state->first_dl_fn_rcv[tn]) { + int32_t delta = GSM::FNDelta(currTime.FN(), state->last_dl_time_rcv[tn].FN()); + if (delta == 1) { + /* usual expected scenario, continue code flow */ + } else if (delta == 0) { + LOGCHAN(chan, DTRXDDL, INFO) << "Rx TRXD msg with repeated FN " << currTime; + state->ctrs.tx_trxd_fn_repeated++; + return RET_OK_UPDSTAT; + } else if (delta < 0) { + LOGCHAN(chan, DTRXDDL, INFO) << "Rx TRXD msg with previous FN " << currTime << " vs last " + << state->last_dl_time_rcv[tn]; + state->ctrs.tx_trxd_fn_outoforder++; + res = RET_OK_UPDSTAT; + /* Allow adding radio vector below, since it gets sorted in the queue */ + } else if (chan == 0 && state->mFiller == FILLER_ZERO) { + /* delta > 1. Some FN was lost in the middle. We can only easily rely + * on consecutive FNs in TRX0 since it must transmit continuously in all + * setups. Also, osmo-trx supports optionally filling empty bursts on + * its own. In that case bts-trx is not obliged to submit all bursts. + */ + LOGCHAN(chan, DTRXDDL, INFO) << "Rx TRXD msg with future FN " << currTime << " vs last " + << state->last_dl_time_rcv[tn] << ", " << delta - 1 << " FN lost"; + state->ctrs.tx_trxd_fn_skipped += delta - 1; + res = RET_OK_UPDSTAT; + } + if (delta > 0) + state->last_dl_time_rcv[tn] = currTime; + } else { /* Initial check, simply store state */ + state->first_dl_fn_rcv[tn] = true; + state->last_dl_time_rcv[tn] = currTime; + } + + BitVector newBurst(burstLen); + BitVector::iterator itr = newBurst.begin(); + uint8_t *bufferItr = dl->soft_bits; + while (itr < newBurst.end()) + *itr++ = *bufferItr++; + + addRadioVector(chan, newBurst, dl->tx_att, currTime); + + return res; +} diff --git a/Transceiver52M/device/websdr/TransceiverWebSdr.h b/Transceiver52M/device/websdr/TransceiverWebSdr.h new file mode 100644 index 0000000..cf17282 --- /dev/null +++ b/Transceiver52M/device/websdr/TransceiverWebSdr.h @@ -0,0 +1,70 @@ +/* + * WebSDR radio transceiver interface + * + * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2026 Wavelet Lab <info(a)wavelet-lab.com> + * + * SPDX-License-Identifier: GPL-3.0+ + * + * This software is distributed under the terms of the GNU Public License. + * See the COPYING file in the main directory for details. + * + * This use of this software may be subject to additional restrictions. + * See the LEGAL file in the main directory for details. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef TRANSCEIVER_WEBSDR_H +#define TRANSCEIVER_WEBSDR_H + +#include "Transceiver.h" +#include "radioInterfaceWebSdr.h" + +class TransceiverWebSdr : public Transceiver { +public: + TransceiverWebSdr(const struct trx_cfg *cfg, + GSM::Time wTransmitLatency, + RadioInterfaceWebSdr *wRadioInterface); + + bool init(void); + + /* Command handling */ + int processCommand(int chan, const char *buffer, char *response, size_t response_size); + + /* RX path methods */ + int driveReceiveRadioShortVector(short **buffers, int samples, int underrun, + TIMESTAMP ts, unsigned samples_skipped); + + /* Obtain receive bursts from QUEUE */ + int driveReceiveFIFOBurst(size_t chan, char *buf, int maxLen); + + /* TX path methods */ + void driveTxFIFO(); + bool driveTxPriorityQueue(size_t chan, char *buffer, int msgLen); + bool on_write_clock(unsigned long long clock); + bool peekClock(unsigned *out); + int post_tx_burst(size_t chan, char* buffer, int msgLen); + +protected: + RadioInterfaceWebSdr *mRadioInterfaceWebSdr; /* associated radioInterfaceWebSdr object */ + + bool mIndClockValid; + unsigned mIndClock; + + bool start(); + void stop(); +}; + +#endif /* TRANSCEIVER_WEBSDR_H */ \ No newline at end of file diff --git a/Transceiver52M/device/websdr/libosmo-trx-websdr.pc.in b/Transceiver52M/device/websdr/libosmo-trx-websdr.pc.in new file mode 100644 index 0000000..5ac04b4 --- /dev/null +++ b/Transceiver52M/device/websdr/libosmo-trx-websdr.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom TRX WebSdr Transceiver Common Library +Description: WebSdr Transceiver common code for osmo-bts +Version: @VERSION@ +Requires: +Requires.private: libosmocore libosmoctrl libosmovty +Libs: -L${libdir} -losmo-trx-websdr +Libs.private: @LIBOSMOCORE_LIBS@ @LIBOSMOCTRL_LIBS@ @LIBOSMOVTY_LIBS@ +Cflags: -I${includedir}/ @LIBOSMOCORE_CFLAGS@ @LIBOSMOCTRL_CFLAGS@ @LIBOSMOVTY_CFLAGS@ diff --git a/Transceiver52M/device/websdr/osmo-trx-websdr.cpp b/Transceiver52M/device/websdr/osmo-trx-websdr.cpp new file mode 100644 index 0000000..39e1c6b --- /dev/null +++ b/Transceiver52M/device/websdr/osmo-trx-websdr.cpp @@ -0,0 +1,216 @@ +/* + * Osmo TRX WebSDR API implementation + * + * Copyright (C) 2013 Thomas Tsou <tom(a)tsou.cc> + * Copyright (C) 2026 Wavelet Lab <info(a)wavelet-lab.com> + * + * SPDX-License-Identifier: LGPL-2.1+ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "TransceiverWebSdr.h" + +#include "radioDevice.h" + +extern "C" { +#include "convolve.h" +#include "convert.h" +#include "trx_vty.h" +} + +#include "osmo-trx-websdr.h" + +#define charp2str(a) ((a) ? std::string(a) : std::string("")) + +int g_no_tx_call; +uint8_t g_tx_buffer[10000]; +uint32_t g_tx_ts; +uint32_t g_tx_len; + +static struct trx_ctx trx_ctx; +static struct trx_ctx* g_trx_ctx = &trx_ctx; + +static RadioDevice *radioDevice; +static RadioInterfaceWebSdr *radio; +static TransceiverWebSdr *transceiverWebSdr; + +RadioInterfaceWebSdr *makeRadioInterface(struct trx_ctx *trx, RadioDevice *radioDevice, int type) +{ + RadioInterfaceWebSdr *radio = NULL; + + switch (type) { + case RadioDevice::NORMAL: + radio = new RadioInterfaceWebSdr(radioDevice, trx->cfg.tx_sps, trx->cfg.rx_sps); + break; + default: + LOG(ALERT) << "Unsupported radio interface configuration"; + return NULL; + } + + if (!radio->init(type)) { + LOG(ALERT) << "Failed to initialize radio interface"; + return NULL; + } + + return radio; +} + +int makeTransceiver(struct trx_ctx *trx, RadioInterfaceWebSdr *radio) +{ + VectorFIFO *fifo; + + transceiverWebSdr = new TransceiverWebSdr(&trx->cfg, GSM::Time(3,0), radio); + if (!transceiverWebSdr->init()) { + LOG(ALERT) << "Failed to initialize transceiver"; + return -1; + } + + for (size_t i = 0; i < trx->cfg.num_chans; i++) { + fifo = radio->receiveFIFO(i); + if (fifo && transceiverWebSdr->receiveFIFO(fifo, i)) + continue; + + LOG(ALERT) << "Could not attach FIFO to channel " << i; + return -1; + } + return 0; +} + +static void trx_stop() +{ + LOG(NOTICE) << "Shutting down transceiver..." << std::endl; + + delete transceiverWebSdr; + delete radio; + delete radioDevice; +} + +static int trx_start(struct trx_ctx *trx) +{ + int type, chans; + unsigned int i; + std::vector<std::string> rx_paths, tx_paths; + RadioDevice::InterfaceType iface = RadioDevice::NORMAL; + + /* Generate vector of rx/tx_path: */ + for (i = 0; i < trx->cfg.num_chans; i++) { + rx_paths.push_back(charp2str(trx->cfg.chans[i].rx_path)); + tx_paths.push_back(charp2str(trx->cfg.chans[i].tx_path)); + } + + radioDevice = RadioDevice::make(iface, &trx->cfg); + type = radioDevice->open(); + if (type < 0) { + LOG(ALERT) << "Failed to create radio device" << std::endl; + goto shutdown; + } + + /* Setup the appropriate device interface */ + radio = makeRadioInterface(trx, radioDevice, type); + if (!radio) + goto shutdown; + + /* Create the transceiver core */ + if (makeTransceiver(trx, radio) < 0) + goto shutdown; + + chans = transceiverWebSdr->numChans(); + LOG(NOTICE) << "-- Transceiver active with " + << chans << " channel(s)" << std::endl; + + return 0; + +shutdown: + trx_stop(); + return -1; +} + +static int trx_start_and_configure() +{ + convolve_init(); + convert_init(); + + g_trx_ctx->cfg.tx_sps = 4; + g_trx_ctx->cfg.rx_sps = 4; + g_trx_ctx->cfg.base_port = 5700; + g_trx_ctx->cfg.bind_addr = (char*)"127.0.0.1"; + g_trx_ctx->cfg.remote_addr = (char*)"127.0.1.1"; + g_trx_ctx->cfg.filler = FILLER_DUMMY; + + g_trx_ctx->cfg.num_chans = 1; + g_trx_ctx->cfg.chans[0].idx = 0; + g_trx_ctx->cfg.chans[0].trx = g_trx_ctx; + g_trx_ctx->cfg.chans[0].rx_path = (char*)"auto"; + g_trx_ctx->cfg.chans[0].tx_path = (char*)"auto"; + + g_trx_ctx->cfg.multi_arfcn = 0; + + srandom(time(NULL)); + + g_no_tx_call = true; + + if(trx_start(g_trx_ctx) < 0) + return EXIT_FAILURE; + + return 0; +} + +/* Osmo TRX WebSDR API */ + +#ifdef __cplusplus +extern "C" { +#endif + +int osmotrxlib_init() +{ + return trx_start_and_configure(); +} + +void osmotrxlib_deinit() +{ + trx_stop(); +} + +int osmotrxlib_process_command(const char* buffer, char* response, size_t response_size) +{ + return transceiverWebSdr->processCommand(0, buffer, response, response_size); +} + +int osmotrxlib_push_rx_short_vector(short* buffers, int samples, int underrun, + unsigned ts, unsigned samples_skipped) +{ + return transceiverWebSdr->driveReceiveRadioShortVector(&buffers, samples, underrun, ts, samples_skipped); +} + +int osmotrxlib_get_rx_burst(char* buf, int maxLen) +{ + return transceiverWebSdr->driveReceiveFIFOBurst(0, buf, maxLen); +} + +int osmotrxlib_get_tx_short_vector() +{ + transceiverWebSdr->driveTxFIFO(); + return 0; +} + +int osmotrxlib_put_tx_burst(char* buffer, int msgLen) +{ + return transceiverWebSdr->driveTxPriorityQueue(0, buffer, msgLen); +} + +#ifdef __cplusplus +} +#endif diff --git a/Transceiver52M/device/websdr/osmo-trx-websdr.h b/Transceiver52M/device/websdr/osmo-trx-websdr.h new file mode 100644 index 0000000..6248d11 --- /dev/null +++ b/Transceiver52M/device/websdr/osmo-trx-websdr.h @@ -0,0 +1,46 @@ +/* + * Osmo TRX WebSDR API + * + * Copyright (C) 2026 Wavelet Lab <info(a)wavelet-lab.com> + * + * SPDX-License-Identifier: LGPL-2.1+ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ + +#ifndef OSMO_TRX_WEBSDR_API_H +#define OSMO_TRX_WEBSDR_API_H + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +int osmotrxlib_init(); +void osmotrxlib_deinit(); + +int osmotrxlib_process_command(const char* buffer, char *response, size_t response_size); + +// RX path +int osmotrxlib_push_rx_short_vector(short* buffers, int samples, int underrun, + unsigned ts, unsigned samples_skipped); +int osmotrxlib_get_rx_burst(char* buf, int maxLen); + +// TX path +int osmotrxlib_get_tx_short_vector(); +int osmotrxlib_put_tx_burst(char* buffer, int msgLen); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Transceiver52M/device/websdr/radioInterfaceWebSdr.cpp b/Transceiver52M/device/websdr/radioInterfaceWebSdr.cpp new file mode 100644 index 0000000..7c440ab --- /dev/null +++ b/Transceiver52M/device/websdr/radioInterfaceWebSdr.cpp @@ -0,0 +1,110 @@ +/* + * WebSDR radio device implementation + * + * Copyright (C) 2008-2014 Free Software Foundation, Inc. + * Copyright (C) 2015 Ettus Research LLC + * Copyright (C) 2026 Wavelet Lab <info(a)wavelet-lab.com> + * + * SPDX-License-Identifier: AGPL-3.0+ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See the COPYING file in the main directory for details. + */ + +#include "radioInterfaceWebSdr.h" + +extern "C" { +#include "convert.h" +} + +#define CHUNK 625 +#define NUMCHUNKS 4 + +int RadioInterfaceWebSdr::driveReceiveRadioWithBuffer(unsigned samples_skipped) +{ + radioVector *burst = NULL; + + GSM::Time rcvClock = mClock.get(); + rcvClock.decTN(receiveOffset); + unsigned tN = rcvClock.TN(); + int recvSz = recvBuffer[0]->getAvailSamples(); + const int symbolsPerSlot = gSlotLen + 8; + int burstSize; + unsigned lost_tN = 0; + + if (mSPSRx == NUMCHUNKS) { + burstSize = CHUNK; + } else { + burstSize = symbolsPerSlot + (tN % NUMCHUNKS == 0); + } + + lost_tN = samples_skipped / burstSize; + + while (lost_tN-- != 0) { + mClock.incTN(); + rcvClock.incTN(); + } + + /* + * Pre-allocate head room for the largest correlation size + * so we can later avoid a re-allocation and copy + */ + size_t head = GSM::gRACHSynchSequenceTS0.size(); + + /* + * Form receive bursts and pass up to transceiver. Use repeating + * pattern of 157-156-156-156 symbols per timeslot + */ + while (recvSz > burstSize) { + for (size_t i = 0; i < mChans; i++) { + burst = new radioVector(rcvClock, burstSize, head); + unRadioifyVector(burst->getVector(), i); + + if (mReceiveFIFO[i].size() < 32) + mReceiveFIFO[i].write(burst); + else + delete burst; + } + + mClock.incTN(); + rcvClock.incTN(); + recvSz -= burstSize; + + tN = rcvClock.TN(); + + if (mSPSRx != NUMCHUNKS) + burstSize = (symbolsPerSlot + (tN % NUMCHUNKS == 0)) * mSPSRx; + } + + return 0; +} + +int RadioInterfaceWebSdr::fillPullBuffer(short **buffers, int samples, int recvunderrun, TIMESTAMP ts) +{ + if (recvBuffer[0]->getFreeSegments() <= 0) + return -EBUSY; + + size_t segmentLen = recvBuffer[0]->getSegmentLen(); + if (segmentLen != samples) + return -EINVAL; + + for (size_t i = 0; i < mChans; i++) { + convert_short_float(recvBuffer[i]->getWriteSegment(), buffers[i], segmentLen * 2); + } + + osmo_trx_sync_or_and_fetch(&underrun, recvunderrun); + readTimestamp += segmentLen; + + return 0; +} diff --git a/Transceiver52M/device/websdr/radioInterfaceWebSdr.h b/Transceiver52M/device/websdr/radioInterfaceWebSdr.h new file mode 100644 index 0000000..b9aa5ba --- /dev/null +++ b/Transceiver52M/device/websdr/radioInterfaceWebSdr.h @@ -0,0 +1,32 @@ +/* + * WebSDR radio device interface + * + * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2026 Wavelet Lab <info(a)wavelet-lab.com> + * + * This software is distributed under multiple licenses; see the COPYING file in the main directory for licensing information for this specific distribution. + * + * This use of this software may be subject to additional restrictions. + * See the LEGAL file in the main directory for details. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef RADIO_INTERFACE_WEBSDR_H +#define RADIO_INTERFACE_WEBSDR_H + +#include "radioInterface.h" + +class RadioInterfaceWebSdr : public RadioInterface { +public: + RadioInterfaceWebSdr(RadioDevice* wDevice, size_t tx_sps, size_t rx_sps); + virtual ~RadioInterfaceWebSdr(); + + int fillPullBuffer(short** buffers, int samples, + int underrun, TIMESTAMP ts); + int driveReceiveRadioWithBuffer(unsigned samples_skipped); +}; + +#endif /* RADIO_INTERFACE_WEBSDR_H */ diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h index cdcfd07..5299a1e 100644 --- a/Transceiver52M/radioInterface.h +++ b/Transceiver52M/radioInterface.h @@ -57,7 +57,7 @@ bool mOn; ///< indicates radio is on -private: +protected: /** format samples to USRP */ int radioifyVector(signalVector &wVector, size_t chan, bool zero); diff --git a/configure.ac b/configure.ac index 01b2f34..7c88440 100644 --- a/configure.ac +++ b/configure.ac @@ -144,6 +144,11 @@ [enable bladeRF]) ]) +AC_ARG_WITH(websdr, [ + AS_HELP_STRING([--with-websdr], + [enable WebUSB based transceiver]) +]) + AC_ARG_WITH(mstrx, [ AS_HELP_STRING([--with-mstrx], [enable MS TRX]) @@ -282,6 +287,7 @@ AM_CONDITIONAL(DEVICE_LMS, [test "x$with_lms" = "xyes"]) AM_CONDITIONAL(DEVICE_IPC, [test "x$with_ipc" = "xyes"]) AM_CONDITIONAL(DEVICE_BLADE, [test "x$with_bladerf" = "xyes"]) +AM_CONDITIONAL(DEVICE_WEBSDR, [test "x$with_websdr" = "xyes"]) AM_CONDITIONAL(ARCH_ARM, [test "x$with_neon" = "xyes" || test "x$with_neon_vfpv4" = "xyes"]) AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"]) AM_CONDITIONAL(ENABLE_MS_TRX, [test "x$with_mstrx" = "xyes"]) @@ -381,6 +387,8 @@ Transceiver52M/device/lms/Makefile \ Transceiver52M/device/ipc/Makefile \ Transceiver52M/device/bladerf/Makefile \ + Transceiver52M/device/websdr/Makefile \ + Transceiver52M/device/websdr/libosmo-trx-websdr.pc \ tests/Makefile \ tests/CommonLibs/Makefile \ tests/Transceiver52M/Makefile \ -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/42411?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Ia0d340c323c2eea28fbe82601ba0af7cfbd68f6d Gerrit-Change-Number: 42411 Gerrit-PatchSet: 1 Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: bsc: fix copy-paste in TC_lcls_gcr_bway_codec_mismatch
by fixeria 16 Mar '26

16 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42390?usp=email ) Change subject: bsc: fix copy-paste in TC_lcls_gcr_bway_codec_mismatch ...................................................................... bsc: fix copy-paste in TC_lcls_gcr_bway_codec_mismatch The comment says that: * first call leg uses FR, * second call leg uses HR, however the code actually modifies the first call leg to use HR. The test still exercises a codec mismatch, so LCLS non-activation is still triggered, but the leg roles are swapped relative to the stated intent. Fix this to avoid confusion. Change-Id: Ie795516a447976ffe7b94ff8efcc649af0e37790 --- M bsc/BSC_Tests_LCLS.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/bsc/BSC_Tests_LCLS.ttcn b/bsc/BSC_Tests_LCLS.ttcn index 37b6198..3def9f2 100644 --- a/bsc/BSC_Tests_LCLS.ttcn +++ b/bsc/BSC_Tests_LCLS.ttcn @@ -409,7 +409,7 @@ /* The second call leg uses half-rate */ pars_b := pars_a; - pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR})); + pars_b.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR})); /* first call is not possible to be LS (no second leg yet) */ pars_a.lcls.exp_sts := LCLS_STS_not_possible_ls; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42390?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ie795516a447976ffe7b94ff8efcc649af0e37790 Gerrit-Change-Number: 42390 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: bts: fix ts_RslChanNr_CBCH4 used in SDCCH/8 TCs
by fixeria 16 Mar '26

16 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42391?usp=email ) Change subject: bts: fix ts_RslChanNr_CBCH4 used in SDCCH/8 TCs ...................................................................... bts: fix ts_RslChanNr_CBCH4 used in SDCCH/8 TCs Change-Id: I505346a5b29b1fa31b7207947f908eafb49c2724 --- M bts/BTS_Tests_SMSCB.ttcn 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/bts/BTS_Tests_SMSCB.ttcn b/bts/BTS_Tests_SMSCB.ttcn index 3cd1919..62ddfc2 100644 --- a/bts/BTS_Tests_SMSCB.ttcn +++ b/bts/BTS_Tests_SMSCB.ttcn @@ -665,7 +665,7 @@ } testcase TC_sms_cb_cmd_sdcch8_default_only() runs on test_CT { var CbchTestPars pars := { - chan_nr := valueof(ts_RslChanNr_CBCH4(0)), + chan_nr := valueof(ts_RslChanNr_CBCH8(2)), basic := valueof(t_CbchPC(msgs_1m_3b_default)), extended := omit }; @@ -893,7 +893,7 @@ } testcase TC_cbc_sdcch8_load_overload() runs on test_CT { var CbchTestPars pars := { - chan_nr := valueof(ts_RslChanNr_CBCH4(2)), + chan_nr := valueof(ts_RslChanNr_CBCH8(2)), basic := valueof(t_CbchPC(msgs_1m_3b_norm)), extended := omit }; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42391?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I505346a5b29b1fa31b7207947f908eafb49c2724 Gerrit-Change-Number: 42391 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: library/GSM_RR_Types: add send/receive variants for t_RrL3Header
by fixeria 16 Mar '26

16 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42392?usp=email ) Change subject: library/GSM_RR_Types: add send/receive variants for t_RrL3Header ...................................................................... library/GSM_RR_Types: add send/receive variants for t_RrL3Header Change-Id: I35e5897470154f0a868fead4800a46849585a201 --- M bsc/BSC_Tests.ttcn M library/GSM_RR_Types.ttcn 2 files changed, 11 insertions(+), 4 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index ef02faf..17f2326 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -10154,7 +10154,7 @@ /* Decode the L3 message and make sure it is (RR) Assignment Command */ var GsmRrL3Message l3_msg := dec_GsmRrL3Message(ie.l3_info.payload); - if (not match(l3_msg.header, t_RrL3Header(ASSIGNMENT_COMMAND))) { + if (not match(l3_msg.header, tr_RrL3Header(ASSIGNMENT_COMMAND))) { setverdict(fail, "Failed to match Assignment Command: ", l3_msg); continue; } @@ -10224,7 +10224,7 @@ /* Decode the L3 message and make sure it is (RR) Handover Command */ var GsmRrL3Message l3_msg := dec_GsmRrL3Message(ie.l3_info.payload); - if (not match(l3_msg.header, t_RrL3Header(HANDOVER_COMMAND))) { + if (not match(l3_msg.header, tr_RrL3Header(HANDOVER_COMMAND))) { setverdict(fail, "Failed to match Handover Command: ", l3_msg); return; } diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn index 963ad0c..3dc1cd5 100644 --- a/library/GSM_RR_Types.ttcn +++ b/library/GSM_RR_Types.ttcn @@ -205,7 +205,14 @@ RrMessageType message_type } with { variant "" }; - template RrL3Header t_RrL3Header(RrMessageType msg_type) := { + template (value) RrL3Header + ts_RrL3Header(template (value) RrMessageType msg_type) := { + skip_indicator := 0, + rr_protocol_discriminator := 6, + message_type := msg_type + } + template (present) RrL3Header + tr_RrL3Header(template (present) RrMessageType msg_type := ?) := { skip_indicator := 0, rr_protocol_discriminator := 6, message_type := msg_type @@ -897,7 +904,7 @@ template (value) GsmRrL3Message ts_MEAS_REP(template (value) MeasurementResults meas_res := ts_MeasurementResults) := { - header := t_RrL3Header(MEASUREMENT_REPORT), + header := ts_RrL3Header(MEASUREMENT_REPORT), payload := { meas_rep := { meas_res := meas_res -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42392?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I35e5897470154f0a868fead4800a46849585a201 Gerrit-Change-Number: 42392 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmocore[master]: netdev: netdev_mnl_set_mtu(): drop unneeded variables
by fixeria 16 Mar '26

16 Mar '26
Attention is currently required from: laforge, pespin. fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/libosmocore/+/42406?usp=email ) Change subject: netdev: netdev_mnl_set_mtu(): drop unneeded variables ...................................................................... Patch Set 2: (1 comment) Patchset: PS1: > The man-page for `mnl_nlmsg_put_extra_header()`: […] Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/42406?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I8f9d39733a80a0ec4e8c462f4ae32b4ac52b5849 Gerrit-Change-Number: 42406 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 16 Mar 2026 09:06:22 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmocore[master]: gsmtap_util: gsmtap_gsm_channel_names[]: fix PTCCH string
by fixeria 16 Mar '26

16 Mar '26
Attention is currently required from: fixeria. Hello Jenkins Builder, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/42409?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder The change is no longer submittable: Verified is unsatisfied now. Change subject: gsmtap_util: gsmtap_gsm_channel_names[]: fix PTCCH string ...................................................................... gsmtap_util: gsmtap_gsm_channel_names[]: fix PTCCH string Change-Id: Ic65668ae0363b991966bcf8ba4fb913940639964 --- M src/core/gsmtap_util.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/42409/2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/42409?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic65668ae0363b991966bcf8ba4fb913940639964 Gerrit-Change-Number: 42409 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmocore[master]: gsm48: remove duplicate GSM48_MT_RR_HANDO_INFO
by fixeria 16 Mar '26

16 Mar '26
Attention is currently required from: fixeria. Hello Jenkins Builder, laforge, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/42408?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder The change is no longer submittable: Verified is unsatisfied now. Change subject: gsm48: remove duplicate GSM48_MT_RR_HANDO_INFO ...................................................................... gsm48: remove duplicate GSM48_MT_RR_HANDO_INFO Change-Id: Ic1cbba2b2a746667b9920ed2ed19b3848185977d --- M include/osmocom/gsm/protocol/gsm_04_08.h M src/gsm/gsm48.c 2 files changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/08/42408/2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/42408?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic1cbba2b2a746667b9920ed2ed19b3848185977d Gerrit-Change-Number: 42408 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmocore[master]: gsm48: fix missing/misspelled value-strings
by fixeria 16 Mar '26

16 Mar '26
Attention is currently required from: fixeria, jolly. Hello Jenkins Builder, jolly, laforge, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/42407?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder The change is no longer submittable: Verified is unsatisfied now. Change subject: gsm48: fix missing/misspelled value-strings ...................................................................... gsm48: fix missing/misspelled value-strings Change-Id: I8d2333290c7715fd75ce7e7c759cb564a26b7461 --- M src/gsm/gsm48.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/07/42407/2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/42407?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I8d2333290c7715fd75ce7e7c759cb564a26b7461 Gerrit-Change-Number: 42407 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmocore[master]: netdev: netdev_mnl_set_mtu(): drop unneeded variables
by fixeria 16 Mar '26

16 Mar '26
Attention is currently required from: laforge, pespin. Hello Jenkins Builder, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/42406?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review-1 by pespin, Verified+1 by Jenkins Builder Change subject: netdev: netdev_mnl_set_mtu(): drop unneeded variables ...................................................................... netdev: netdev_mnl_set_mtu(): drop unneeded variables Change-Id: I8f9d39733a80a0ec4e8c462f4ae32b4ac52b5849 --- M src/core/netdev.c 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/06/42406/2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/42406?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I8f9d39733a80a0ec4e8c462f4ae32b4ac52b5849 Gerrit-Change-Number: 42406 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • ...
  • 194
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.