Skip to content

Commit a577352

Browse files
committed
Merge branch 'development' into ir
Change infrared wait time flag to -W to fix conflict with the new development-branch -w flag for tuner bandwidth Conflicts: src/rtl_tcp.c
2 parents c4e955c + 13a070b commit a577352

23 files changed

+1198
-455
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,15 @@ CMakeCache.txt
3939
*/CMakeFiles
4040
CMakeFiles
4141
*.cmake
42+
build
43+
44+
**/*.o
45+
**/*.so*
46+
**/*.a
47+
src/rtl_adsb
48+
src/rtl_eeprom
49+
src/rtl_fm
50+
src/rtl_power
51+
src/rtl_test
52+
53+
debianize/*.deb

circle.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

debian/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.deb

debian/debianize

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#!/bin/bash
2+
3+
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../"
4+
5+
G_REV=`git rev-parse --short=8 HEAD`
6+
DATE=`date +"%Y%m%d%H%M%S"`
7+
#VERSION="0.5.3-git+${DATE}.${G_REV}~$1"
8+
VERSION=`git describe | cut -dv -f2`
9+
#
10+
# librtlsdr0
11+
#
12+
13+
rm -fr /tmp/librtlsdr0/
14+
mkdir -p /tmp/librtlsdr0/
15+
mkdir -p /tmp/librtlsdr0/usr/lib/x86_64-linux-gnu/
16+
mkdir -p /tmp/librtlsdr0/DEBIAN
17+
18+
cat <<- EOF > /tmp/librtlsdr0/DEBIAN/control
19+
Package: librtlsdr0
20+
Source: rtl-sdr
21+
Version: ${VERSION}
22+
Architecture: amd64
23+
Maintainer: Lucas Teske <[email protected]>
24+
Pre-Depends: multiarch-support
25+
Depends: libc6 (>= 2.14), libusb-1.0-0 (>= 2:1.0.9)
26+
Section: libs
27+
Priority: extra
28+
Multi-Arch: same
29+
Homepage: http://sdr.osmocom.org/trac/wiki/rtl-sdr
30+
Description: Software defined radio receiver for Realtek RTL2832U (library)
31+
rtl-sdr is a software defined radio (SDR) receiver software for certain
32+
low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U chip.
33+
.
34+
This package contains the shared library.
35+
EOF
36+
37+
DEB_PKG="librtlsdr0_${VERSION}_amd64.deb"
38+
39+
cp -rf ${REPO_DIR}/build/src/lib*so* /tmp/librtlsdr0/usr/lib/x86_64-linux-gnu/
40+
dpkg-deb -b /tmp/librtlsdr0/ ./${DEB_PKG}
41+
42+
echo ${DEB_PKG}
43+
44+
#
45+
# rtl-sdr
46+
#
47+
48+
rm -fr /tmp/rtl-sdr/
49+
mkdir -p /tmp/rtl-sdr/
50+
mkdir -p /tmp/rtl-sdr/usr/bin/
51+
mkdir -p /tmp/rtl-sdr/DEBIAN
52+
53+
cat <<- EOF > /tmp/rtl-sdr/DEBIAN/control
54+
Package: rtl-sdr
55+
Version: ${VERSION}
56+
Architecture: amd64
57+
Maintainer: Lucas Teske <[email protected]>
58+
Depends: librtlsdr0 (= ${VERSION}), libc6 (>= 2.15)
59+
Section: libs
60+
Priority: extra
61+
Homepage: http://sdr.osmocom.org/trac/wiki/rtl-sdr
62+
Description: Software defined radio receiver for Realtek RTL2832U (tools)
63+
rtl-sdr is a software defined radio (SDR) receiver software for certain
64+
low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U chip.
65+
.
66+
This package contains a set of command line utilities:
67+
* rtl_adsb: a simple ADS-B decoder for RTL2832 based DVB-T receivers
68+
* rtl_eeprom: an EEPROM programming tool for RTL2832 based DVB-T receivers
69+
* rtl_fm: a narrow band FM demodulator for RTL2832 based DVB-T receivers
70+
* rtl_sdr: an I/Q recorder for RTL2832 based DVB-T receivers
71+
* rtl_tcp: an I/Q spectrum server for RTL2832 based DVB-T receivers
72+
* rtl_test: a benchmark tool for RTL2832 based DVB-T receivers
73+
74+
75+
EOF
76+
77+
DEB_PKG="rtl-sdr_${VERSION}_amd64.deb"
78+
79+
cp -rf ${REPO_DIR}/build/src/rtl_* /tmp/rtl-sdr/usr/bin/
80+
dpkg-deb -b /tmp/rtl-sdr/ ./${DEB_PKG}
81+
82+
echo ${DEB_PKG}
83+
84+
85+
#
86+
# librtlsdr-dev
87+
#
88+
89+
rm -fr /tmp/librtlsdr-dev/
90+
mkdir -p /tmp/librtlsdr-dev/
91+
mkdir -p /tmp/librtlsdr-dev/usr/include
92+
mkdir -p /tmp/librtlsdr-dev/usr/lib/x86_64-linux-gnu/pkgconfig
93+
mkdir -p /tmp/librtlsdr-dev/DEBIAN
94+
95+
cat <<- EOF > /tmp/librtlsdr-dev/DEBIAN/control
96+
Package: librtlsdr-dev
97+
Source: rtl-sdr
98+
Version: ${VERSION}
99+
Architecture: amd64
100+
Maintainer: Lucas Teske <[email protected]>
101+
Pre-Depends: multiarch-support
102+
Depends: librtlsdr0 (= ${VERSION})
103+
Section: libdevel
104+
Priority: extra
105+
Homepage: http://sdr.osmocom.org/trac/wiki/rtl-sdr
106+
Description: Software defined radio receiver for Realtek RTL2832U (development files)
107+
rtl-sdr is a software defined radio (SDR) receiver software for certain
108+
low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U chip.
109+
.
110+
This package contains development files.
111+
112+
EOF
113+
114+
DEB_PKG="librtlsdr-dev_${VERSION}_amd64.deb"
115+
116+
cp -rf ${REPO_DIR}/include/*.h /tmp/librtlsdr-dev/usr/include
117+
dpkg-deb -b /tmp/librtlsdr-dev/ ./${DEB_PKG}
118+
119+
echo ${DEB_PKG}

include/rtl-sdr.h

100644100755
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extern "C" {
2626

2727
#include <stdint.h>
2828
#include <rtl-sdr_export.h>
29+
#include <rtl_tcp.h>
2930

3031
typedef struct rtlsdr_dev rtlsdr_dev_t;
3132

@@ -142,6 +143,13 @@ RTLSDR_API int rtlsdr_write_eeprom(rtlsdr_dev_t *dev, uint8_t *data,
142143
RTLSDR_API int rtlsdr_read_eeprom(rtlsdr_dev_t *dev, uint8_t *data,
143144
uint8_t offset, uint16_t len);
144145

146+
/*!
147+
* Set the frequency the device is tuned to.
148+
*
149+
* \param dev the device handle given by rtlsdr_open()
150+
* \param frequency in Hz
151+
* \return 0 on error, frequency in Hz otherwise
152+
*/
145153
RTLSDR_API int rtlsdr_set_center_freq(rtlsdr_dev_t *dev, uint32_t freq);
146154

147155
/*!
@@ -220,9 +228,14 @@ RTLSDR_API int rtlsdr_set_tuner_gain(rtlsdr_dev_t *dev, int gain);
220228
*
221229
* \param dev the device handle given by rtlsdr_open()
222230
* \param bw bandwidth in Hz. Zero means automatic BW selection.
231+
* \param applied_bw is applied bandwidth in Hz, or 0 if unknown
232+
* \param apply_bw: 1 to really apply configure the tuner chip; 0 for just returning applied_bw
223233
* \return 0 on success
224234
*/
225-
RTLSDR_API int rtlsdr_set_tuner_bandwidth(rtlsdr_dev_t *dev, uint32_t bw);
235+
RTLSDR_API int rtlsdr_set_and_get_tuner_bandwidth(rtlsdr_dev_t *dev, uint32_t bw, uint32_t *applied_bw, int apply_bw );
236+
237+
RTLSDR_API int rtlsdr_set_tuner_bandwidth(rtlsdr_dev_t *dev, uint32_t bw );
238+
226239

227240
/*!
228241
* Get actual gain the device is configured to.
@@ -232,6 +245,17 @@ RTLSDR_API int rtlsdr_set_tuner_bandwidth(rtlsdr_dev_t *dev, uint32_t bw);
232245
*/
233246
RTLSDR_API int rtlsdr_get_tuner_gain(rtlsdr_dev_t *dev);
234247

248+
/*!
249+
* Set LNA / Mixer / VGA Device Gain for R820T device is configured to.
250+
*
251+
* \param dev the device handle given by rtlsdr_open()
252+
* \param lna_gain in tenths of a dB, -30 means -3.0 dB.
253+
* \param mixer_gain in tenths of a dB, -30 means -3.0 dB.
254+
* \param vga_gain in tenths of a dB, -30 means -3.0 dB.
255+
* \return 0 on success
256+
*/
257+
RTLSDR_API int rtlsdr_set_tuner_gain_ext(rtlsdr_dev_t *dev, int lna_gain, int mixer_gain, int vga_gain);
258+
235259
/*!
236260
* Set the intermediate frequency gain for the device.
237261
*

include/rtl_tcp.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* rtl-sdr, turns your Realtek RTL2832 based DVB dongle into a SDR receiver
3+
* Copyright (C) 2012-2013 by Steve Markgraf <[email protected]>
4+
* Copyright (C) 2012 by Dimitri Stolnikov <[email protected]>
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 2 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
#ifndef __RTL_TCP_H
21+
#define __RTL_TCP_H
22+
23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif
26+
27+
/*!
28+
* This enum defines the possible commands in rtl_tcp
29+
*/
30+
enum RTL_TCP_COMMANDS {
31+
SET_FREQUENCY = 0x01,
32+
SET_SAMPLE_RATE = 0x02,
33+
SET_GAIN_MODE = 0x03,
34+
SET_GAIN = 0x04,
35+
SET_FREQUENCY_CORRECTION = 0x05,
36+
SET_IF_STAGE = 0x06,
37+
SET_TEST_MODE = 0x07,
38+
SET_AGC_MODE = 0x08,
39+
SET_DIRECT_SAMPLING = 0x09,
40+
SET_OFFSET_TUNING = 0x0A,
41+
SET_RTL_CRYSTAL = 0x0B,
42+
SET_TUNER_CRYSTAL = 0x0C,
43+
SET_TUNER_GAIN_BY_INDEX = 0x0D,
44+
SET_TUNER_BANDWIDTH = 0x0E
45+
};
46+
47+
#ifdef __cplusplus
48+
}
49+
#endif
50+
51+
#endif

0 commit comments

Comments
 (0)