aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/Transceiver.cpp
AgeCommit message (Collapse)AuthorFilesLines
2018-04-24Transceiver: Move device specific code to radioDevice classPau Espin Pedrol1-7/+1
Change-Id: Ibcf258d8bf8595e286682e0bc59391b239ea7642
2018-03-14Transceiver.cpp: prevent out-of-range array accessVadim Yanitskiy1-8/+16
There was no a simple range check for both (NO)HANDOVER commands, so an out-of-range access was possible. For example, a command: CMD HANDOVER 0 -3 might enable EDGE at run-time, because: a[i] == *(a + i) Let's fix this. Change-Id: I24a5f70e8e8097f218d7cbdef8cb10df2c35416f
2018-03-14Transceiver.cpp: fix incorrect format string for SETTSCVadim Yanitskiy1-1/+1
Change-Id: If69a478121a31aa7df945548cc17271c476d6a6b
2018-03-14Transceiver.cpp: use pointer arithmetics for CMD parsingVadim Yanitskiy1-51/+64
It looks like the author of control command parsing code was not familar with simple pointer arithmetics, so excessive amount of memory and useless memcopying was used to parse a single command. Let's introduce two pointers, one of which will point to the beginning of a command, another to the beginning of its arguments. Also, let's simplify the command matching by using a separate function called 'MATCH_CMD'. Change-Id: I226ca0771e63228cf5e04ef9766057d4107fdd11
2018-03-14Transceiver.cpp: properly zero-terminate received commandsVadim Yanitskiy1-9/+9
Previously it was assumed that a sender should zero-terminate each command being sent. Otherwise, this could cause to printing garbage. Let's do this manually, using the length of received data as a position for '\0'. Change-Id: I69f413f33156c38a853efc5a8cdc66fbfb0ca6af
2018-03-14Transceiver.cpp: use a define for the MAX_PACKET_LENGTHVadim Yanitskiy1-2/+2
No need to keep this value on stack. Change-Id: If9ffb03b9e7b642f45732ba5938977bca271f1c7
2018-03-05Move enums required by VTY to a separate headerPau Espin Pedrol1-9/+9
This patch is a preparation for next patches, which add full VTY cfg support. Change-Id: I3d5b0576aa96869756f1629a40306c0043b6304b
2017-08-16Add -j option to bind to specific addressPau Espin Pedrol1-5/+6
Before this patch, the binding of the listening sockets was hardcoded to a local IP. Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec
2017-07-04transceiver: Avoid sending clock indications when trx is not powered onPau Espin Pedrol1-8/+5
Stop calling writeClockInterface() when receiving commands in Transceiver::driveControl, otherwise it fools osmo-bts-trx clock skew check because it is always sending a clock indication with the same fn when it issues any commands during the time in between CMD POWEROFF and RSP POWERON, because fn is not increased during that period. Also use mForceClockInterface flag to delay delivery of first IND CLOCK until we start serving frames, otherwise the first one is sent and only after a long period of time the next clock indications are sent, when the radio starts to process bursts. That makes osmo-bts-trx unhappy because it expects to receive an IND CLOCK aprox at least every 400 frames. This way also we send the first IND CLOCK after the RSP POWERON 0 response. Change-Id: I91b81a4d7627cec39c1814a39ed4be306681b874
2017-07-04cosmetic: transciever: Remove trailing whitespacesPau Espin Pedrol1-9/+9
Change-Id: Ib3fbe768048b2a34a75ace9688e306720e67019a
2017-06-16transceiver: Fix POWEROFF crash on USRP2/N200/X300 devicesTom Tsou1-5/+4
Upon issuing POWEROFF command to a running transceiver, UHD interfacing thread state may become undefined if the device is stopped with I/O threads still active. Bad behavior is device dependent with only network based USRP devices affected. USB based device thread behavior stops and shutdowns as expected. Tested with N200, X300, and B210. Tested solutions include the following: 1. Set pthread_setcanceltype() with PTHREAD_CANCEL_ASYNCHRONOUS 2. Add sleep delay to allow I/O threads to timeout before stopping the device 3. Wait for I/O threads to join after cancellation before stopping the device This patch resolves the issue by with the third approach. Number 1 is not guaranteed to always work with UHD internals as driver code may explicitly set thread parameters. Using sleep calls to fix order-of-operation issues is almost never a good idea. Change-Id: Ib72ab98a27a02084b040319046c92d1c4157ae4c
2017-04-03Transceiver: Remove unsigned negative comparesTom Tsou1-2/+2
Change-Id: I49f30699786c52736ef334dae61f7bbd65d878d5 Fixes: Coverity CID 149353, 149356
2017-03-28Move Transceiver::demodulate() to sigProcLib to make it reusable.Alexander Chemeris1-13/+1
Change-Id: I2cad47160e53f65612bd1da8998c83a0a22bce9b
2017-03-28Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to make it reusable.Alexander Chemeris1-9/+0
Change-Id: I5a888890e26858c0fbb2ddb7ef23cb0fd66a64b4
2017-03-24Move Transceiver::detectBurst() to sigProcLib to make it reusable.Alexander Chemeris1-33/+2
Change-Id: I3cbe8e6e4f39dde02c945e6c9086c040e276845c
2017-03-24Move CorrType type from Transceiver to sigProcLib.Alexander Chemeris1-3/+3
Required to move Transceiver::detectBurst to sigProcLib. Change-Id: I3e0e74a98bbca4d19657f50a5fb447f078663c9b
2017-03-22Call vectorSlicer() right before packing bits for transmission to osmo-bts.Alexander Chemeris1-0/+3
vectorSlicer() converts soft-bits from -1..+1 to 0..1 while we want to keep SoftVector in -1..+1 mode until the last minute, because at some point we'll want to transmit -1..+1 to osmo-bts instead of converting it from 0..1 back to -1..+1 on the osmo-bts side. Plus it removes code duplication - we call it once instead of twice. Change-Id: Idd6ddd7ac219afb0df055a692632678b66373764
2017-03-22sigProcLib: Rename demodulateBurst() to demodGmskBurst() for clarity.Alexander Chemeris1-1/+1
Change-Id: Ibcef8d7d4a2c06865bed7e4091ccc8dbbd494d77
2017-03-22sigProcLib: make energyDetect() simpler by returning actual energy.Alexander Chemeris1-2/+2
Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
2016-10-25transceiver: Fix command build warningTom Tsou1-2/+3
Place conditional brackets on handover table reset. Reset table only on successful start or restart. Change-Id: I74032b49785bd68835a0a68cb0f14cdaab4fcd26
2016-07-19transceiver: Fix 4 SPS receive TOA valueTom Tsou1-1/+1
The time-of-arrival (TOA) value out of sigProc is specified in symbols or, equivalently, 1 sample per symbol and does not need to be normalized. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-19transceiver: Fix mixed GSMK / 8-PSK transmissionTom Tsou1-1/+1
Input burst construction was declared static causing the first downlink burst from upstream to determine subsequent burst size and modulation. Consequently, fixed sequence EGPRS tests would pass, however, switching between 8-PSK and GMSK bursts would fail with only one modulation type being transmitted. Internally generated test sequences '-r' option were not affected because the bursts are not received through the socket interface. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-08mcbts: Allow out of order channel setupTom Tsou1-2/+1
Previous checks on multi-channel TSC and ARFCN settings would fail if channels were initialized out of order. Namely, if channel 0 was not configured first, osmo-trx would error on the control interface leading osmo-bts to fail. Allow global TSC setting on all channels with added logging notice. Notify if channel frequency is unexpected - which may happen if channels are setup out of order - but do no report as error. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-07transceiver: Remove HANDOVER warningsTom Tsou1-2/+0
These warnings simply echo the socket command arguments with no indication of any unexpected or improper operation. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-01egprs: Enable 8-PSK burst detection when EDGE is enabledTom Tsou1-2/+8
The command line EDGE option will enable 8-PSK burst detection on any slot where a normal burst is expected. The burst search order is 8-PSK first followed by GMSK. EDGE will force 4 SPS sampling on Tx and Rx. Along with twice the search correlation from 8-PSK and GMSK, EDGE will increase CPU utilization. Whether the increase is notable or not is dependent on the particular machine. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-01egprs: Enable 8-PSK length vectors on the Tx interfaceTom Tsou1-3/+11
Allow EGPRS 8-PSK length bit vectors of length 444 (148 * 3) to pass in through the Tx socket interface. Length is the sole factor in determining whether to modulate a bit vector using GMSK or 8-PSK. Tested with 8-PSK training sequences with random payload originating from osmo-bts. Output verified with Agilent E4406A. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-01sigproc: Adjust burst detection threshold criteriaTom Tsou1-5/+13
Reduce the burst detection threshold to pass more bursts to upper layers, but force stricter requirements on the computation itself. For the latter, we now require at least 5 samples (rather than 2) to compute a peak-to-average value. End result is increased burst detection at low SNR conditions with a small increase in false positive bursts when no signal is present. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-06-28transceiver: Do not report error on SETTSC when radio is onTom Tsou1-1/+1
OsmoTRX does not support the use of multiple TSC settings per internal TRX instance. There should not be an error to modifiy the TSC value after POWERON. Setting TSC value on TRX channels other then 0 is a NOP operation that should only error if the requested TSC differs from that of TRX channel 0. Reported-by: Max <msuraev@sysmocom.de> Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-06-22transceiver: Add an option to emulate a RACH delay in random filler mode.Alexander Chemeris1-4/+4
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-06-22transceiver: Log channel number in DEBUG output of demoded bursts.Alexander Chemeris1-2/+3
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-05-02common: Add mandatory length field to UDP receive callsTom Tsou1-2/+2
Current UDP receive reads up to MAX_UDP_LENGTH bytes into the passed in buffer, which may lead to buffer overflow if the write buffer is of insufficient size. Add mandatory length argument to UDP socket receive calls. Reported-by: Simone Margaritelli <simone@zimperium.com> Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-04-26transceiver: Do not pass transceiver state struct to function where it's not ↵Alexander Chemeris1-6/+5
used.
2016-04-20transceiver: Add an option to generate random Access Bursts.Alexander Chemeris1-0/+3
2016-04-20transceiver: Properly handle MAXDLY.Alexander Chemeris1-5/+14
Previously MAXDLY value was applied to Normal Bursts, which was nice when working with sloppy test equipment like CMD57, but useless for real world usage. At the same time documentation and de facto usage of MAXDLY in OsmoBTS and OpenBTS assumed that it actually applies to Access Bursts (RACH). So this patch changes osmo-rx behavior to apply MAXDLY to RACH bursts and introduces a new command MAXDLYNB for the old behavior.
2016-03-08EDGE: Add random burst generator filler optionTom Tsou1-3/+8
When EDGE is enabled with the '-e' option, the random burst generator switches from GMSK normal bursts to 8-PSK EDGE bursts. $ ./osmo-trx -e -r 7 Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-08sigproc: Add various GSM burst generatorsTom Tsou1-41/+3
Setup generators for empty, random, and dummy bursts. This moves error prone burst length handling out of the Transceiver and into the signal processing core. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-08EDGE: Add interfaces to enable EDGE transceiverTom Tsou1-36/+69
Create EDGE slot type in the Transceiver. When EDGE mode is enabled for a particular slot, blind detection will be performed by correlating against EDGE followed by normal bursts if no EDGE burst is found. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-06EDGE: Setup variable sampling on receive pathTom Tsou1-2/+2
Allow setting the device to non single SPS sample rates - mainly running at 4 SPS as the signal processing library does not support other rates. Wider bandwith support is required on the receive path to avoid 8-PSK bandlimiting distortion for EDGE. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-06sigproc: Remove normal burst DFE equalizerTom Tsou1-81/+20
DFE equalizer is unused and has been experiencing code rot for multiple years. The effect is a significant amount of baggage being carried in the Transceiver and interfaces. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-06sigproc: Remove dynamic SPS configurationTom Tsou1-2/+1
Samples per symbol used by the transceiver is not configurable through the socket interface once running, so stop pretending like it could be. Initialize all tables and midambles at start. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30Transceiver: Add support for OsmoBTS style handover.Alexander Chemeris1-4/+46
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30transceiver: Add a debug option to dump selected timeslots to disk.Alexander Chemeris1-1/+26
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30Transceiver: Do not update state->SNRestimate if equalization is disabled.Alexander Chemeris1-4/+4
This also fix a bug of using bool type for noise instead of float. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30sigProcLib: Abstract out common part of Normal/RACH burst detection.Alexander Chemeris1-3/+3
As a side change - get rid of passing toa and amp arguments as pointers and use references instead. The commit doesn't change behaviour, but makes the code cleaner. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30Transceiver: Update noise level only when the timeslot is marked as IDLE.Alexander Chemeris1-15/+31
We can't rely on an assumption that if we can't decode a burst - it's noise. There are many rasons why we can't decode a burst even if it's well above the noise level. Just one example is a RACH burst which can be overlapped with another RACH burst up to a level both are completely unrecognizable. Another example is when a burst is destroyed by bad multi-path. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30transceiver: Remove noise/RSSI gating.Alexander Chemeris1-2/+1
It does more harm than good. the current noise calculation is too error prone, so we can't trust it. And we end up loosing perfectly good bursts because of that. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30Transceiver: Fix clipping detection.Alexander Chemeris1-15/+18
There are two primary changes in this commit: 1) Return values of detect functions changed form bool to int to actually pass the return value from the inner function and notify higher levels about clipping. Previously the information was lost due to conversion to bool. 2) Clipping level is not the final verdict now. We still try to demod a burst and mark it as clipped only if the level is above the clipping level AND we can't demod it. The reasoning for this is that in real life we want to do as much as possible to demod the burst, because we want to get as much from our dynamic range as possible. So a little bit of clipping is fine and is expected. We just don't want too much of it to break our demod. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30Transceiver: Print noise level for each burst in debug mode.Alexander Chemeris1-9/+12
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30osmo-trx: Add a command line option for the dBFS to dBm offset.Alexander Chemeris1-19/+27
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-06-01transceiver: Drive clock indication form the receive thread.Alexander Chemeris1-10/+5
Receive thread receives data from the device, which is a more stable source of clocking than the transmit side. If transmit side has a hiccup, osmo-trx doesn't send the clock indication, and transmit side is getting completely lost in time. With this patch we ensure that clock indication keeps coming. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>