Skip to content

Commit

Permalink
Add TransceiverBLADERF to OpenBTS-UMTS
Browse files Browse the repository at this point in the history
  • Loading branch information
rghilduta committed Dec 31, 2017
1 parent d528034 commit 7cf94d9
Show file tree
Hide file tree
Showing 26 changed files with 3,691 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ASN/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4856,7 +4856,7 @@ regen: $O/$(KEYFILE)

$O/$(KEYFILE):
-mkdir $O
cd $O && asn1c -fcompound-names -pdu=auto -gen-PER ../rrc.asn1
cd $O && asn1c -fcompound-names -pdu=auto -fwide-types -gen-PER ../rrc.asn1


Makefile: ./sample.makefile.regen ./rrc.asn1
Expand Down
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ SUBDIRS = \
SMS \
TransceiverRAD1 \
TransceiverUHD \
TransceiverBLADERF \
TRXManager \
Control \
NodeManager \
Expand All @@ -47,5 +48,6 @@ install: all
$(MAKE) -C ./apps install
$(MAKE) -C ./TransceiverRAD1 install
$(MAKE) -C ./TransceiverUHD install
$(MAKE) -C ./TransceiverBLADERF install

FORCE:
4 changes: 2 additions & 2 deletions SGSNGGSN/Sgsn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void SgsnInfo::sirm()
{
std::ostringstream ss;
sgsnInfoDump(this,ss);
SGSNLOG("Removing SgsnInfo:"<<ss);
//SGSNLOG("Removing SgsnInfo:"<<ss);
sSgsnInfoList.remove(this);
delete this;
}
Expand Down Expand Up @@ -221,7 +221,7 @@ static void GmmRemove(GmmInfo *gmm)
{
std::ostringstream ss;
gmmInfoDump(gmm,ss,0);
SGSNLOG("Removing gmm:"<<ss);
//SGSNLOG("Removing gmm:"<<ss);
SgsnInfo *si;
RN_FOR_ALL(SgsnInfoList_t,sSgsnInfoList,si) {
// The second test here should be redundant.
Expand Down
3 changes: 1 addition & 2 deletions SGSNGGSN/SgsnBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ extern bool sgsnDebug();
//#define GGSNLOG1(level,who,stuff) if (IS_LOG_LEVEL(level)||SGSN::sgsnDebug()) _LOG(level)<<who<<timestr()<<","<<stuff;
#define GGSNLOG1(level,who,stuff) if (IS_LOG_LEVEL(level)||SGSN::sgsnDebug()) _LOG(level)<<who<<stuff;
// Normal log plus put it in the ggsn.log file.
#define GGSNLOG2(level,who,stuff) GGSNLOG1(level,who,stuff); \
if (SGSN::sgsnDebug()) {MGLOG(who<<stuff);}
#define GGSNLOG2(level,who,stuff) GGSNLOG1(level,who,stuff);
#define GGSNLOG(stuff) GGSNLOG2(INFO,"SGSN:",stuff)
#define LLCDEBUG(stuff) GGSNLOG1(DEBUG,"LLC:",stuff)
#define SNDCPDEBUG(stuff) GGSNLOG1(DEBUG,"SNDCP:",stuff)
Expand Down
2 changes: 1 addition & 1 deletion SIP/SIPInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ const char* extractIMSI(const osip_message_t *msg)
unsigned namelen = strlen(IMSI);
if ((namelen>19)||(namelen<18)) {
LOG(WARNING) << "INVITE with malformed username \"" << IMSI << "\"";
return false;
return NULL;
}
// Skip first 4 char "IMSI".
return IMSI+4;
Expand Down
3 changes: 2 additions & 1 deletion SMS/SMSMessages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ RPData *SMS::hex2rpdata(const char *hexstring)

BitVector RPDUbits(strlen(hexstring)*4);
if (!RPDUbits.unhex(hexstring)) {
return false;
return NULL;
//return false;
}
LOG(DEBUG) << "SMS RPDU bits: " << RPDUbits;

Expand Down
34 changes: 34 additions & 0 deletions TransceiverBLADERF/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
if HAVE_BLADERF
include $(top_srcdir)/Makefile.common

noinst_LTLIBRARIES = libumtstransceiver.la
noinst_PROGRAMS = transceiver
noinst_HEADERS = \
RadioInterface.h \
RadioDevice.h \
Transceiver.h \
SampleBuffer.h \
bladeRFDevice.h \
Resampler.h \
convolve.h \
convert.h

libumtstransceiver_la_CFLAGS = -Wall $(AM_CFLAGS) -std=gnu99 -march=native
libumtstransceiver_la_CPPFLAGS = -Wall $(AM_CPPFLAGS) $(BLADERF_CPPFLAGS)
libumtstransceiver_la_CXXFLAGS = -Wall $(AM_CXXFLAGS) $(BLADERF_CXXFLAGS)
libumtstransceiver_la_SOURCES = \
RadioInterface.cpp \
Transceiver.cpp \
bladeRFDevice.cpp \
SampleBuffer.cpp \
Resampler.cpp \
convolve.c \
convert.c

transceiver_SOURCES = runTransceiver.cpp ../apps/GetConfigurationKeys.cpp
transceiver_LDADD = libumtstransceiver.la $(BLADERF_LIBS) $(UMTS_LA) $(GSM_LA) $(COMMON_LA) $(SQLITE_LA)

install: transceiver
mkdir -p "$(DESTDIR)/OpenBTS/"
install transceiver "$(DESTDIR)/OpenBTS/"
endif
100 changes: 100 additions & 0 deletions TransceiverBLADERF/RadioDevice.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#ifndef __RADIO_DEVICE_H__
#define __RADIO_DEVICE_H__

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

/** A class to handle a USRP rev 4, with a two RFX900 daughterboards */
class RadioDevice {
public:
virtual ~RadioDevice() { }

/* Available transport bus types */
enum TxWindowType { TX_WINDOW_USRP1, TX_WINDOW_FIXED };

/** Start the USRP */
virtual bool start()=0;

/** Stop the USRP */
virtual bool stop()=0;

/** Get the Tx window type */
virtual enum TxWindowType getWindowType()=0;

/** Enable thread priority */
virtual void setPriority()=0;

/**
Read samples from the radio.
@param buf preallocated buf to contain read result
@param len number of samples desired
@param overrun Set if read buffer has been overrun, e.g. data not being read fast enough
@param timestamp The timestamp of the first samples to be read
@param underrun Set if radio does not have data to transmit, e.g. data not being sent fast enough
@param RSSI The received signal strength of the read result
@return The number of samples actually read
*/
virtual int readSamples(short *buf, int len, bool *overrun,
long long timestamp, bool *underrun,
unsigned *RSSI=NULL)=0;
/**
Write samples to the radio.
@param buf Contains the data to be written.
@param len number of samples to write.
@param underrun Set if radio does not have data to transmit, e.g. data not being sent fast enough
@param timestamp The timestamp of the first sample of the data buffer.
@param isControl Set if data is a control packet, e.g. a ping command
@return The number of samples actually written
*/
virtual int writeSamples(short *buf, int len, bool *underrun,
long long timestamp)=0;

/** Set the transmitter frequency */
virtual bool setTxFreq(double wFreq)=0;

/** Set the receiver frequency */
virtual bool setRxFreq(double wFreq)=0;

/** Returns the starting write Timestamp*/
virtual long long initialWriteTimestamp(void)=0;

/** Returns the starting read Timestamp*/
virtual long long initialReadTimestamp(void)=0;

/** returns the full-scale transmit amplitude **/
virtual double fullScaleInputValue()=0;

/** returns the full-scale receive amplitude **/
virtual double fullScaleOutputValue()=0;

/** sets the receive chan gain, returns the gain setting **/
virtual double setRxGain(double dB)=0;

/** gets the current receive gain **/
virtual double getRxGain(void)=0;

/** return maximum Rx Gain **/
virtual double maxRxGain(void) = 0;

/** return minimum Rx Gain **/
virtual double minRxGain(void) = 0;

/** sets the transmit chan gain, returns the gain setting **/
virtual double setTxGain(double dB)=0;

/** return maximum Tx Gain **/
virtual double maxTxGain(void) = 0;

/** return minimum Tx Gain **/
virtual double minTxGain(void) = 0;

/** Return internal status values */
virtual double getTxFreq()=0;
virtual double getRxFreq()=0;
virtual double getSampleRate()=0;
virtual double numberRead()=0;
virtual double numberWritten()=0;
};

#endif /* __RADIO_DEVICE_H__ */
Loading

0 comments on commit 7cf94d9

Please sign in to comment.