├── BladeRF
├── Registration.txt
├── SDRSharp.BladeRF.dll.manifest
├── Properties
│ └── AssemblyInfo.cs
├── SDRSharp.BladeRF.csproj
├── BladeRFControllerDialog.resx
├── BladeRFIO.cs
├── BladeRFControllerDialog.cs
├── BladeRFControllerDialog.Designer.cs
└── BladeRFDevice.cs
├── LibBladeRF
├── ad936x.lib
├── bladeRF.dll
├── bladeRF.exp
├── bladeRF.lib
├── bladeRF-cli.exe
├── bladeRF-fsk.exe
├── libusb-1.0.dll
├── pthreadVC2.dll
├── libbladeRF_test_c.exe
├── bladeRF-fsk_test_prng.exe
├── libbladeRF_test_async.exe
├── libbladeRF_test_cpp.exe
├── libbladeRF_test_ctrl.exe
├── libbladeRF_test_open.exe
├── libbladeRF_test_parse.exe
├── libbladeRF_test_sync.exe
├── test_dc_calibration.exe
├── bladeRF-fsk_test_config.exe
├── bladeRF-fsk_test_crc32.exe
├── bladeRF-fsk_test_pnorm.exe
├── bladeRF-fsk_test_suite.exe
├── libbladeRF_test_version.exe
├── libbladeRF_test_freq_hop.exe
├── libbladeRF_test_fw_check.exe
├── libbladeRF_test_repeater.exe
├── libbladeRF_test_rx_discont.exe
├── libbladeRF_test_timestamps.exe
├── licenses
│ ├── Cypress
│ │ └── license.txt
│ ├── bladeRF
│ │ ├── COPYING
│ │ ├── LICENSE.MIT.nuand
│ │ ├── LICENSE.MIT.msc_stdbool
│ │ ├── LICENSE.BSD.vlfeat
│ │ ├── LICENSE.BSD.msc_inttypes
│ │ ├── LICENSE.BSD.nuand
│ │ ├── LICENSE.GPLv2
│ │ └── LICENSE.LGPLv2.1
│ ├── pthreads-win32
│ │ └── COPYING.LIB.txt
│ └── libusb
│ │ └── COPYING
├── bladeRF-fsk_test_correlator.exe
├── bladeRF-fsk_test_fir_filter.exe
├── libbladeRF_test_interleaver.exe
├── libbladeRF_test_quick_retune.exe
├── libbladeRF_test_unused_sync.exe
├── libbladeRF_test_repeated_stream.exe
├── libbladeRF_test_digital_loopback.exe
├── libbladeRF_test_scheduled_retune.exe
└── libbladeRF_test_bootloader_recovery.exe
├── Release
└── SDRSharp.BladeRF.dll
├── .gitignore
├── .gitattributes
├── SDRSharp.BladeRF.sln
└── README.md
/BladeRF/Registration.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/LibBladeRF/ad936x.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/ad936x.lib
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF.dll
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF.exp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF.exp
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF.lib
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF-cli.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF-cli.exe
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF-fsk.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF-fsk.exe
--------------------------------------------------------------------------------
/LibBladeRF/libusb-1.0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libusb-1.0.dll
--------------------------------------------------------------------------------
/LibBladeRF/pthreadVC2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/pthreadVC2.dll
--------------------------------------------------------------------------------
/Release/SDRSharp.BladeRF.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/Release/SDRSharp.BladeRF.dll
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_c.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_c.exe
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF-fsk_test_prng.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF-fsk_test_prng.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_async.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_async.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_cpp.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_cpp.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_ctrl.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_ctrl.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_open.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_open.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_parse.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_parse.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_sync.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_sync.exe
--------------------------------------------------------------------------------
/LibBladeRF/test_dc_calibration.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/test_dc_calibration.exe
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF-fsk_test_config.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF-fsk_test_config.exe
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF-fsk_test_crc32.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF-fsk_test_crc32.exe
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF-fsk_test_pnorm.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF-fsk_test_pnorm.exe
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF-fsk_test_suite.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF-fsk_test_suite.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_version.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_version.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_freq_hop.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_freq_hop.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_fw_check.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_fw_check.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_repeater.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_repeater.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_rx_discont.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_rx_discont.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_timestamps.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_timestamps.exe
--------------------------------------------------------------------------------
/LibBladeRF/licenses/Cypress/license.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/licenses/Cypress/license.txt
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF-fsk_test_correlator.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF-fsk_test_correlator.exe
--------------------------------------------------------------------------------
/LibBladeRF/bladeRF-fsk_test_fir_filter.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/bladeRF-fsk_test_fir_filter.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_interleaver.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_interleaver.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_quick_retune.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_quick_retune.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_unused_sync.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_unused_sync.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_repeated_stream.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_repeated_stream.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_digital_loopback.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_digital_loopback.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_scheduled_retune.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_scheduled_retune.exe
--------------------------------------------------------------------------------
/LibBladeRF/libbladeRF_test_bootloader_recovery.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmichelp/sdrsharp-bladerf/HEAD/LibBladeRF/libbladeRF_test_bootloader_recovery.exe
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | BladeRF/obj/*
2 | BladeRF/bin/*
3 | Debug/*
4 | Release/SDRSharp.Common.dll
5 | Release/SDRSharp.Radio.dll
6 | Release/*.xml
7 | Release/SDRSharp.BladeRF.dll.*
8 | *.suo
9 | *.user
10 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/bladeRF/COPYING:
--------------------------------------------------------------------------------
1 | The various portions of the bladeRF project are licensed as outlined below.
2 |
3 | FPGA HDL: MIT
4 | FX3 Firmware: MIT
5 | libbladeRF: LGPLv2.1
6 | bladeRF-cli: GPLv2
7 | Linux kernel driver: GPLv2
8 |
9 | Please see the legal/licenses directory in the source tree for the text of each
10 | license. You can find this online at:
11 |
12 | https://github.com/Nuand/bladeRF/tree/master/legal/licenses
13 |
14 | Note that the misc. source files in the host/common and host/utilities/common
15 | source directories vary in their licenses (but are compatible with above items
16 | they are linked with). Please see the individual files and/or their associated
17 | files in the legal/licenses directory for additional information.
18 |
19 | Licenses may vary for FPGA IP located in the hdl/fpga/ip directory tree.
20 | Please see the individual files for additional information.
21 |
22 | All metadata and build scripts are MIT license unless otherwise stated.
23 |
24 | Please contact bladeRF@Nuand.com if you have any question or concerns.
25 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/bladeRF/LICENSE.MIT.nuand:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013-2018 Nuand LLC
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/bladeRF/LICENSE.MIT.msc_stdbool:
--------------------------------------------------------------------------------
1 | Copyright 2007-2010 VMware, Inc.
2 | All Rights Reserved.
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a
5 | copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sub license, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 | FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
15 | THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
16 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
17 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18 | USE OR OTHER DEALINGS IN THE SOFTWARE.
19 |
20 | The above copyright notice and this permission notice (including the
21 | next paragraph) shall be included in all copies or substantial portions
22 | of the Software.
23 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/bladeRF/LICENSE.BSD.vlfeat:
--------------------------------------------------------------------------------
1 | Copyright (C) 2007-11, Andrea Vedaldi and Brian Fulkerson
2 | Copyright (C) 2012-13, The VLFeat Team
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are
7 | met:
8 | 1. Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | 2. Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the
13 | distribution.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/BladeRF/SDRSharp.BladeRF.dll.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/bladeRF/LICENSE.BSD.msc_inttypes:
--------------------------------------------------------------------------------
1 | Copyright (c) 2006-2013 Alexander Chemeris
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are met:
5 |
6 | 1. Redistributions of source code must retain the above copyright notice,
7 | this list of conditions and the following disclaimer.
8 |
9 | 2. Redistributions in binary form must reproduce the above copyright
10 | notice, this list of conditions and the following disclaimer in the
11 | documentation and/or other materials provided with the distribution.
12 |
13 | 3. Neither the name of the product nor the names of its contributors may
14 | be used to endorse or promote products derived from this software
15 | without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
20 | EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
--------------------------------------------------------------------------------
/BladeRF/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("BladeRF Plugin for SDR#")]
9 | [assembly: AssemblyDescription("BladeRF Plugin for SDR#")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SDR#")]
13 | [assembly: AssemblyCopyright("Copyright © Jean-Michel Picod 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("fb41709c-fdd7-4a80-aa0b-de4324ce4441")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.1.0")]
36 | [assembly: AssemblyFileVersion("1.0.1.0")]
37 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/bladeRF/LICENSE.BSD.nuand:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013-2017, Nuand LLC
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification,
5 | are permitted provided that the following conditions are met:
6 |
7 | - Redistributions of source code must retain the above copyright notice,
8 | this list of conditions and the following disclaimer.
9 |
10 | - Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | - Neither the names of Nuand LLC, nor the bladeRF project, nor the names of
15 | its contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
26 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/SDRSharp.BladeRF.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio Express 2012 for Windows Desktop
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDRSharp.BladeRF", "BladeRF\SDRSharp.BladeRF.csproj", "{41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}"
4 | EndProject
5 | Global
6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 | Debug|Any CPU = Debug|Any CPU
8 | Debug|x64 = Debug|x64
9 | Debug|x86 = Debug|x86
10 | Release|Any CPU = Release|Any CPU
11 | Release|x64 = Release|x64
12 | Release|x86 = Release|x86
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
17 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Debug|x64.ActiveCfg = Debug|x64
18 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Debug|x64.Build.0 = Debug|x64
19 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Debug|x86.ActiveCfg = Debug|x86
20 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Debug|x86.Build.0 = Debug|x86
21 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
22 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Release|Any CPU.Build.0 = Release|Any CPU
23 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Release|x64.ActiveCfg = Release|x64
24 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Release|x64.Build.0 = Release|x64
25 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Release|x86.ActiveCfg = Release|x86
26 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}.Release|x86.Build.0 = Release|x86
27 | EndGlobalSection
28 | GlobalSection(SolutionProperties) = preSolution
29 | HideSolutionNode = FALSE
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # sdrsharp-bladerf
2 |
3 | bladeRF driver for SDR#
4 |
5 |
6 | ## Installation
7 |
8 | ### Windows
9 |
10 | 1. Copy the Release\SDRSharp.BladeRF.dll into SDR# installation directory
11 | 2. If required, copy all DLL files from LibBladeRF subdirectory to SDR# installation directory
12 | 3. Add the following line in the frontendPlugins sections of FrontEnds.xml file:
13 |
14 | <add key="BladeRF" value="SDRSharp.BladeRF.BladeRFIO,SDRSharp.BladeRF" />
15 |
16 |
17 | 4. Launch SDR# and cross fingers :)
18 |
19 | **Be aware that any update of SDR# will require you to follow again steps 2 to 4!**
20 |
21 | ### Linux
22 |
23 | To use SDR# on Linux, you need to first install a version of Mono that supports .Net framework 4.6.
24 |
25 | At the moment, the setup has been tested using Mono 4.4.0.40 and is working.
26 |
27 |
28 | 1. Copy the Release/SDRSharp.BladeRF.dll into SDR# installation directory
29 | 2. Symlink required libraries in the SDR# installation directory:
30 |
31 | ```bash
32 | $ ln -s /usr/lib/libportaudio.so.2 libportaudio.so
33 | $ ln -s /usr/local/lib/libbladeRF.so .
34 | ```
35 |
36 | 3. Add the following line in the frontendPlugins sections of FrontEnds.xml file:
37 |
38 | <add key="BladeRF" value="SDRSharp.BladeRF.BladeRFIO,SDRSharp.BladeRF" />
39 |
40 |
41 | 4. Launch SDR# and cross fingers :)
42 |
43 | **Be aware that any update of SDR# will require you to follow again steps 2 to 4!**
44 |
45 | ## Troubleshooting
46 |
47 | If your samples look "weird" under SDR#, be sure to use a compatible libusb-1.0.dll.
48 | Specially when frequently upgrading SDR#, it will re-install the RTL-SDR driver which embedds a pretty old version of this DLL (v.1.0.14).
49 | The version provided under LibBladeRF directory of this repository (currently v1.0.19) is known to work correcly with both RTL-SDR dongles and BladeRF. So it is safe (and recommended) to replace it.
50 |
51 | If this does not solve your issue, feel free to report a bug here. I will try to fix it as soon as possible.
52 | Same goes for new features.
53 |
54 |
55 | ## Compilation
56 |
57 | If you need/want to compile this DLL, you need to copy the following two DLL files
58 | from SDR# installation directory to Release and/or Debug directories:
59 |
60 | 1. SDRSharp.Radio.dll
61 | 2. SDRSharp.Common.dll
62 |
63 | Compiling under Linux is also possible using Mono 4.4.0.40+ (even if a warning is issued to tell that building with framework 4.6 is
64 | not supported.
65 |
66 | Be aware that Mono xbuild uses different pathes for compilation so you will need to copy the 2 aforementioned DLL files in the
67 | building directory expected by Mono xbuild for the compilation to succeed.
68 |
69 |
70 | ## Bugs? Ideas?
71 |
72 | Please report them using the bugtracker on the Github project!
73 |
--------------------------------------------------------------------------------
/BladeRF/SDRSharp.BladeRF.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {41C6CC2E-5F1D-4BFC-9676-381AD488FCD6}
9 | Library
10 | Properties
11 | SDRSharp.BladeRF
12 | SDRSharp.BladeRF
13 | v4.6
14 | 512
15 |
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 | true
26 | false
27 |
28 |
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 | true
36 | false
37 |
38 |
39 | true
40 | bin\x64\Debug\
41 | DEBUG;TRACE
42 | full
43 | x64
44 | prompt
45 | true
46 | false
47 |
48 |
49 | bin\x64\Release\
50 | TRACE
51 | true
52 | pdbonly
53 | x64
54 | prompt
55 | true
56 | false
57 |
58 |
59 | true
60 | ..\Debug\
61 | DEBUG;TRACE
62 | full
63 | x86
64 | prompt
65 | true
66 | false
67 |
68 |
69 | ..\Release\
70 | TRACE
71 | true
72 | none
73 | x86
74 | prompt
75 | true
76 | true
77 | false
78 |
79 |
80 | SDRSharp.BladeRF.dll.manifest
81 |
82 |
83 |
84 | False
85 | ..\..\SDRsharp\SDRSharp.Common.dll
86 |
87 |
88 | False
89 | ..\..\SDRsharp\SDRSharp.Radio.dll
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 | Form
100 |
101 |
102 | BladeRFControllerDialog.cs
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 | BladeRFControllerDialog.cs
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | Designer
120 |
121 |
122 |
123 |
130 |
--------------------------------------------------------------------------------
/BladeRF/BladeRFControllerDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 137, 17
125 |
126 |
--------------------------------------------------------------------------------
/BladeRF/BladeRFIO.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using System.ComponentModel;
4 |
5 | using SDRSharp.Common;
6 | using SDRSharp.Radio;
7 |
8 | namespace SDRSharp.BladeRF
9 | {
10 | public class BladeRFIO : IFrontendController, IIQStreamController, IDisposable, ISampleRateChangeSource , IFloatingConfigDialogProvider, ITunableSource, IControlAwareObject, ISpectrumProvider
11 | {
12 | private const string _displayName = "BladeRF";
13 | private readonly BladeRFControllerDialog _gui;
14 | private BladeRFDevice _bladeRFDevice;
15 | private long _frequency;
16 | private double _frequencyCorrection;
17 | private SDRSharp.Radio.SamplesAvailableDelegate _callback;
18 | public event EventHandler SampleRateChanged;
19 |
20 | public BladeRFIO()
21 | {
22 | _frequency = 405500000L;
23 | _gui = new BladeRFControllerDialog(this);
24 | bladerf_version v = NativeMethods.bladerf_version();
25 | if (v.major == 0 && v.minor < 14)
26 | {
27 | MessageBox.Show(String.Format("Your bladerf.dll is outdated. Upgrade to v0.14+ (now using {0})", v.describe));
28 | }
29 | }
30 |
31 | ~BladeRFIO()
32 | {
33 | Dispose();
34 | }
35 |
36 | public void Dispose()
37 | {
38 | Close();
39 | if (_gui != null)
40 | {
41 | _gui.Close();
42 | _gui.Dispose();
43 | }
44 | GC.SuppressFinalize(this);
45 | }
46 |
47 | public void SelectDevice(string serial)
48 | {
49 | Close();
50 | _bladeRFDevice = new BladeRFDevice(serial);
51 | _bladeRFDevice.SamplesAvailable += BladeRFDevice_SamplesAvailable;
52 | _bladeRFDevice.SampleRateChanged += BladeRFDevice_SampleRateChanged;
53 | _bladeRFDevice.Frequency = _frequency;
54 | _gui.ConfigureGUI();
55 | _gui.ConfigureDevice();
56 | }
57 |
58 | public BladeRFDevice Device
59 | {
60 | get
61 | {
62 | return _bladeRFDevice;
63 | }
64 | }
65 |
66 | public void Open()
67 | {
68 | DeviceDisplay[] activeDevices = DeviceDisplay.GetActiveDevices();
69 | if (null == activeDevices)
70 | throw new ApplicationException("No compatible devices found");
71 | foreach (DeviceDisplay deviceDisplay in activeDevices)
72 | {
73 | try
74 | {
75 | SelectDevice(deviceDisplay.Serial);
76 | return;
77 | }
78 | catch
79 | {
80 | }
81 | }
82 | if (activeDevices.Length > 0)
83 | throw new ApplicationException(activeDevices.Length + " compatible devices have been found but are all busy");
84 | else
85 | throw new ApplicationException("No compatible devices found");
86 | }
87 |
88 | public void Close()
89 | {
90 | if (_bladeRFDevice == null)
91 | return;
92 | _bladeRFDevice.SamplesAvailable -= BladeRFDevice_SamplesAvailable;
93 | _bladeRFDevice.SampleRateChanged -= BladeRFDevice_SampleRateChanged;
94 | _bladeRFDevice.Dispose();
95 | _bladeRFDevice = null;
96 | }
97 |
98 | private void BladeRFDevice_SampleRateChanged(object sender, EventArgs e)
99 | {
100 | if (SampleRateChanged != null)
101 | SampleRateChanged(this, EventArgs.Empty);
102 | }
103 |
104 | public void Start(SDRSharp.Radio.SamplesAvailableDelegate callback)
105 | {
106 | if (_bladeRFDevice == null)
107 | throw new ApplicationException("No device selected");
108 | _callback = callback;
109 | _bladeRFDevice.Start();
110 | }
111 |
112 | public void Stop()
113 | {
114 | if (_bladeRFDevice != null)
115 | {
116 | _bladeRFDevice.Stop();
117 | }
118 | }
119 |
120 | public bool IsSoundCardBased
121 | {
122 | get
123 | {
124 | return false;
125 | }
126 | }
127 |
128 | public string SoundCardHint
129 | {
130 | get
131 | {
132 | return string.Empty;
133 | }
134 | }
135 |
136 | public void ShowSettingGUI(IWin32Window parent)
137 | {
138 | if (this._gui.IsDisposed)
139 | return;
140 | _gui.Show();
141 | _gui.Activate();
142 | }
143 |
144 | public void HideSettingGUI()
145 | {
146 | if (_gui.IsDisposed)
147 | return;
148 | _gui.Hide();
149 | }
150 |
151 | public double Samplerate
152 | {
153 | get
154 | {
155 | if (_bladeRFDevice != null)
156 | return _bladeRFDevice.SampleRate;
157 | else
158 | return 0.0;
159 | }
160 | }
161 |
162 | public long Frequency
163 | {
164 | get
165 | {
166 | return _frequency;
167 | }
168 | set
169 | {
170 | if (this._bladeRFDevice == null)
171 | return;
172 | this._bladeRFDevice.Frequency = (long)(value * (1.0 + this._frequencyCorrection * 1E-06));
173 | this._frequency = value;
174 | }
175 | }
176 |
177 | public double FrequencyCorrection
178 | {
179 | get
180 | {
181 | return this._frequencyCorrection;
182 | }
183 | set
184 | {
185 | this._frequencyCorrection = value;
186 | this.Frequency = this._frequency;
187 | }
188 | }
189 |
190 | private unsafe void BladeRFDevice_SamplesAvailable(object sender, SamplesAvailableEventArgs e)
191 | {
192 | _callback(this, e.Buffer, e.Length);
193 | }
194 |
195 | public float UsableSpectrumRatio
196 | {
197 | get
198 | {
199 | // TODO: should I set it to 0.8f instead?
200 | return 1.0f;
201 | }
202 | }
203 |
204 | public void SetControl(object control)
205 | {
206 | this._gui.Control = (ISharpControl) control;
207 | }
208 | }
209 | }
210 |
--------------------------------------------------------------------------------
/BladeRF/BladeRFControllerDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Forms;
4 | using SDRSharp.Common;
5 | using SDRSharp.Radio;
6 |
7 | namespace SDRSharp.BladeRF
8 | {
9 | public partial class BladeRFControllerDialog : Form
10 | {
11 | private readonly BladeRFIO _owner;
12 | private bool _initialized;
13 |
14 | public BladeRFControllerDialog(BladeRFIO owner)
15 | {
16 | InitializeComponent();
17 |
18 | _owner = owner;
19 | InitSampleRates();
20 | InitBandwidths();
21 | InitXB200Filters();
22 | var devices = DeviceDisplay.GetActiveDevices();
23 | deviceComboBox.Items.Clear();
24 | if (devices != null)
25 | deviceComboBox.Items.AddRange(devices);
26 |
27 | samplerateComboBox.SelectedIndex = Utils.GetIntSetting("BladeRFSampleRate", 3);
28 | samplingModeComboBox.SelectedIndex = Utils.GetIntSetting("BladeRFSamplingMode", (int) bladerf_sampling.BLADERF_SAMPLING_INTERNAL);
29 | rxVga1GainTrackBar.Value = Utils.GetIntSetting("BladeRFVGA1Gain", 20);
30 | rxVga2GainTrackBar.Value = Utils.GetIntSetting("BladeRFVGA2Gain", 20);
31 | lnaGainTrackBar.Value = Utils.GetIntSetting("BladeRFLNAGain", (int) bladerf_lna_gain.BLADERF_LNA_GAIN_MID);
32 | fpgaTextBox.Text = Utils.GetStringSetting("BladeRFFPGA", "");
33 | bandwidthComboBox.SelectedIndex = Utils.GetIntSetting("BladeRFBandwidth", 0);
34 |
35 | xb200Checkbox.Checked = Utils.GetBooleanSetting("BladeRFXB200Enabled");
36 | xb200FilterCombobox.SelectedIndex = Utils.GetIntSetting("BladeRFXB200Filter", 0);
37 |
38 | labelVersion.Text = "libbladerf " + NativeMethods.bladerf_version().describe;
39 |
40 | rxVga1gainLabel.Text = rxVga1GainTrackBar.Value + " dB";
41 | rxVga2gainLabel.Text = rxVga2GainTrackBar.Value + " dB";
42 | lnaGainLabel.Text = String.Format("{0} dB", 3 * (lnaGainTrackBar.Value - 1)); ;
43 |
44 | _initialized = true;
45 | }
46 |
47 | private bool Initialized
48 | {
49 | get
50 | {
51 | return _initialized && _owner.Device != null;
52 | }
53 | }
54 |
55 | private void InitSampleRates()
56 | {
57 | for (int i = 40; i > 0; i--)
58 | samplerateComboBox.Items.Add(String.Format("{0} MSPS", i));
59 | for (int i = 900; i > 0; i -= 300)
60 | samplerateComboBox.Items.Add(String.Format("0.{0} MSPS", i));
61 | samplerateComboBox.Items.Add("0.200 MSPS");
62 | samplerateComboBox.Items.Add("0.160 MSPS");
63 | }
64 |
65 | private void InitBandwidths()
66 | {
67 | bandwidthComboBox.Items.Clear();
68 | bandwidthComboBox.DisplayMember = "Text";
69 | bandwidthComboBox.ValueMember = "Value";
70 | bandwidthComboBox.Items.Add(new ComboboxItem("auto", 0));
71 | bandwidthComboBox.Items.Add(new ComboboxItem("28 MHz", 28000000));
72 | bandwidthComboBox.Items.Add(new ComboboxItem("20 MHz", 20000000));
73 | bandwidthComboBox.Items.Add(new ComboboxItem("14 MHz", 14000000));
74 | bandwidthComboBox.Items.Add(new ComboboxItem("12 MHz", 12000000));
75 | bandwidthComboBox.Items.Add(new ComboboxItem("10 MHz", 10000000));
76 | bandwidthComboBox.Items.Add(new ComboboxItem("8.75 MHz", 8750000));
77 | bandwidthComboBox.Items.Add(new ComboboxItem("7 MHz", 7000000));
78 | bandwidthComboBox.Items.Add(new ComboboxItem("6 MHz", 6000000));
79 | bandwidthComboBox.Items.Add(new ComboboxItem("5.5 MHz", 5500000));
80 | bandwidthComboBox.Items.Add(new ComboboxItem("5 MHz", 5000000));
81 | bandwidthComboBox.Items.Add(new ComboboxItem("3.84 MHz", 3840000));
82 | bandwidthComboBox.Items.Add(new ComboboxItem("3 MHz", 3000000));
83 | bandwidthComboBox.Items.Add(new ComboboxItem("2.75 MHz", 2750000));
84 | bandwidthComboBox.Items.Add(new ComboboxItem("2.5 MHz", 2500000));
85 | bandwidthComboBox.Items.Add(new ComboboxItem("1.75 MHz", 1750000));
86 | bandwidthComboBox.Items.Add(new ComboboxItem("1.5 MHz", 1500000));
87 | }
88 |
89 | private void InitXB200Filters()
90 | {
91 | xb200FilterCombobox.Items.Clear();
92 | xb200FilterCombobox.Items.Add("auto");
93 | xb200FilterCombobox.Items.Add("50 MHz");
94 | xb200FilterCombobox.Items.Add("144 MHz");
95 | xb200FilterCombobox.Items.Add("222 MHz");
96 | xb200FilterCombobox.Items.Add("Custom");
97 | xb200FilterCombobox.Items.Add("Auto (1dB)");
98 | xb200FilterCombobox.Items.Add("Auto (3dB)");
99 | }
100 |
101 | private void closeButton_Click(object sender, EventArgs e)
102 | {
103 | Close();
104 | }
105 |
106 | private void BladeRFControllerDialog_FormClosing(object sender, FormClosingEventArgs e)
107 | {
108 | e.Cancel = true;
109 | Hide();
110 | }
111 |
112 | private void BladeRFControllerDialog_VisibleChanged(object sender, EventArgs e)
113 | {
114 | refreshTimer.Enabled = Visible;
115 | if (Visible)
116 | {
117 | deviceComboBox.Enabled = Initialized && !_owner.Device.IsStreaming;
118 | xb200Checkbox.Enabled = Initialized && !_owner.Device.IsStreaming;
119 |
120 | if (Initialized && !_owner.Device.IsStreaming)
121 | {
122 | var devices = DeviceDisplay.GetActiveDevices();
123 | deviceComboBox.Items.Clear();
124 | if (devices != null)
125 | {
126 | deviceComboBox.Items.AddRange(devices);
127 |
128 | for (var i = 0; i < devices.Length; i++)
129 | {
130 | if (devices[i].Index == ((DeviceDisplay)(deviceComboBox.Items[i])).Index)
131 | {
132 | _initialized = false;
133 | deviceComboBox.SelectedIndex = i;
134 | _initialized = true;
135 | break;
136 | }
137 | }
138 | }
139 | }
140 | }
141 | }
142 |
143 | private void refreshTimer_Tick(object sender, EventArgs e)
144 | {
145 | deviceComboBox.Enabled = Initialized && !_owner.Device.IsStreaming;
146 | xb200Checkbox.Enabled = Initialized && !_owner.Device.IsStreaming;
147 | }
148 |
149 | private void deviceComboBox_SelectedIndexChanged(object sender, EventArgs e)
150 | {
151 | if (!Initialized)
152 | {
153 | return;
154 | }
155 | var deviceDisplay = (DeviceDisplay) deviceComboBox.SelectedItem;
156 | if (deviceDisplay != null)
157 | {
158 | try
159 | {
160 | _owner.SelectDevice(deviceDisplay.Serial);
161 | }
162 | catch (Exception ex)
163 | {
164 | deviceComboBox.SelectedIndex = -1;
165 | MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
166 | }
167 | }
168 | }
169 |
170 | private void samplerateComboBox_SelectedIndexChanged(object sender, EventArgs e)
171 | {
172 | if (!Initialized)
173 | {
174 | return;
175 | }
176 | var samplerateString = samplerateComboBox.Items[samplerateComboBox.SelectedIndex].ToString().Split(' ')[0];
177 | var sampleRate = double.Parse(samplerateString, CultureInfo.InvariantCulture);
178 | _owner.Device.SampleRate = (uint) (sampleRate * 1000000.0);
179 | Utils.SaveSetting("BladeRFSampleRate", samplerateComboBox.SelectedIndex);
180 | }
181 |
182 | private void samplingModeComboBox_SelectedIndexChanged(object sender, EventArgs e)
183 | {
184 | if (!Initialized)
185 | {
186 | return;
187 | }
188 | _owner.Device.Sampling = samplingModeComboBox.SelectedIndex;
189 | Utils.SaveSetting("BladeRFSamplingMode", samplingModeComboBox.SelectedIndex);
190 | }
191 |
192 | public void ConfigureGUI()
193 | {
194 | if (!Initialized)
195 | return;
196 |
197 | bladeRFTypeLabel.Text = _owner.Device.Name;
198 |
199 | for (var i = 0; i < deviceComboBox.Items.Count; i++)
200 | {
201 | var deviceDisplay = (DeviceDisplay) deviceComboBox.Items[i];
202 | if (deviceDisplay.Serial == _owner.Device.Serial)
203 | {
204 | deviceComboBox.SelectedIndex = i;
205 | break;
206 | }
207 | }
208 | }
209 |
210 | public void ConfigureDevice()
211 | {
212 | samplerateComboBox_SelectedIndexChanged(null, null);
213 | samplingModeComboBox_SelectedIndexChanged(null, null);
214 | rxVga1GainTrackBar_Scroll(null, null);
215 | rxVga2GainTrackBar_Scroll(null, null);
216 | lnaGainTrackBar_Scroll(null, null);
217 | xb200Checkbox_CheckedChanged(null, null);
218 | xb200FilterCombobox_SelectedIndexChanged(null, null);
219 | bandwidthComboBox_SelectedIndexChanged(null, null);
220 | }
221 |
222 | private void rxVga1GainTrackBar_Scroll(object sender, EventArgs e)
223 | {
224 | if (!Initialized)
225 | {
226 | return;
227 | }
228 | _owner.Device.VGA1Gain = rxVga1GainTrackBar.Value;
229 | rxVga1gainLabel.Text = rxVga1GainTrackBar.Value + " dB";
230 | Utils.SaveSetting("BladeRFVGA1Gain", rxVga1GainTrackBar.Value);
231 | }
232 |
233 | private void rxVga2GainTrackBar_Scroll(object sender, EventArgs e)
234 | {
235 | if (!Initialized)
236 | {
237 | return;
238 | }
239 | _owner.Device.VGA2Gain = rxVga2GainTrackBar.Value;
240 | rxVga2gainLabel.Text = rxVga2GainTrackBar.Value + " dB";
241 | Utils.SaveSetting("BladeRFVGA2Gain", rxVga2GainTrackBar.Value);
242 | }
243 |
244 | private void lnaGainTrackBar_Scroll(object sender, EventArgs e)
245 | {
246 | if (!Initialized)
247 | {
248 | return;
249 | }
250 | _owner.Device.LNAGain = (uint) lnaGainTrackBar.Value;
251 | lnaGainLabel.Text = String.Format("{0} dB", 3 * (lnaGainTrackBar.Value - 1));
252 | Utils.SaveSetting("BladeRFLNAGain", lnaGainTrackBar.Value);
253 | }
254 |
255 | private void fpgaButton_Click(object sender, EventArgs e)
256 | {
257 | if (!Initialized)
258 | {
259 | return;
260 | }
261 | if (fpgaOpenFileDialog.ShowDialog() == DialogResult.OK)
262 | {
263 | fpgaTextBox.Text = fpgaOpenFileDialog.FileName;
264 | Utils.SaveSetting("BladeRFFPGA", fpgaTextBox.Text);
265 | _owner.Device.FPGAImage = fpgaTextBox.Text;
266 | }
267 | }
268 |
269 | private void xb200Checkbox_CheckedChanged(object sender, EventArgs e)
270 | {
271 | if (!Initialized)
272 | return;
273 | xb200FilterCombobox.Enabled = xb200Checkbox.Checked;
274 | Utils.SaveSetting("BladeRFXB200Enabled", xb200Checkbox.Checked);
275 | _owner.Device.XB200Enabled = xb200Checkbox.Checked;
276 | }
277 |
278 | private void xb200FilterCombobox_SelectedIndexChanged(object sender, EventArgs e)
279 | {
280 | if (!Initialized)
281 | return;
282 | Utils.SaveSetting("BladeRFXB200Filter", xb200FilterCombobox.SelectedIndex);
283 | _owner.Device.XB200Filter = xb200FilterCombobox.SelectedIndex;
284 | }
285 |
286 | private void bandwidthComboBox_SelectedIndexChanged(object sender, EventArgs e)
287 | {
288 | if (!Initialized)
289 | return;
290 | Utils.SaveSetting("BladeRFBandwidth", bandwidthComboBox.SelectedIndex);
291 | try
292 | {
293 | _owner.Device.Bandwidth = (bandwidthComboBox.SelectedItem as ComboboxItem).Value;
294 | }
295 | catch
296 | {
297 | _owner.Device.Bandwidth = 0;
298 | }
299 | }
300 |
301 | private class ComboboxItem
302 | {
303 | public string Text { get; set; }
304 | public int Value { get; set; }
305 |
306 | public ComboboxItem(string text, int value)
307 | {
308 | Text = text;
309 | Value = value;
310 | }
311 |
312 | public override string ToString()
313 | {
314 | return Text;
315 | }
316 | }
317 |
318 | public ISharpControl Control
319 | {
320 | get;
321 | set;
322 | }
323 | }
324 |
325 | public class DeviceDisplay
326 | {
327 | public int Index { get; private set; }
328 | public string Name { get; set; }
329 | public string Serial { get; private set; }
330 | public int Bus { get; set; }
331 | public int Address { get; set; }
332 | public string Backend { get; set; }
333 |
334 | public unsafe static DeviceDisplay[] GetActiveDevices()
335 | {
336 | IntPtr _tmp;
337 | bladerf_devinfo* devlist;
338 | int count = NativeMethods.bladerf_get_device_list(out _tmp);
339 | if (_tmp == IntPtr.Zero)
340 | {
341 | return null;
342 | }
343 | DeviceDisplay[] result = new DeviceDisplay[count];
344 | devlist = (bladerf_devinfo*)_tmp;
345 |
346 | for (int i = 0; i < count; i++)
347 | {
348 | int bus = (int)(devlist[i].usb_bus);
349 | int address = (int)(devlist[i].usb_addr);
350 | string backend = NativeMethods.backend_to_str(devlist[i].backend);
351 | string serial = new String(devlist[i].serial, 0, 32, System.Text.Encoding.ASCII);
352 | string name = String.Format("BladeRF ({0}) SN#{1}..{2} ({3}:{4})", backend, serial.Substring(0, 4), serial.Substring(27, 4), bus, address);
353 | result[i] = new DeviceDisplay { Index = i, Name = name, Serial = serial, Address = address, Bus = bus, Backend = backend };
354 | }
355 | NativeMethods.bladerf_free_device_list(_tmp);
356 | return result;
357 | }
358 |
359 | public override string ToString()
360 | {
361 | return Name;
362 | }
363 | }
364 | }
365 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/bladeRF/LICENSE.GPLv2:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |
294 | Copyright (C)
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | , 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/BladeRF/BladeRFControllerDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace SDRSharp.BladeRF
2 | {
3 | partial class BladeRFControllerDialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.refreshTimer = new System.Windows.Forms.Timer(this.components);
33 | this.closeButton = new System.Windows.Forms.Button();
34 | this.deviceComboBox = new System.Windows.Forms.ComboBox();
35 | this.label1 = new System.Windows.Forms.Label();
36 | this.rxVga2GainTrackBar = new System.Windows.Forms.TrackBar();
37 | this.label2 = new System.Windows.Forms.Label();
38 | this.label3 = new System.Windows.Forms.Label();
39 | this.samplerateComboBox = new System.Windows.Forms.ComboBox();
40 | this.rxVga2gainLabel = new System.Windows.Forms.Label();
41 | this.bladeRFTypeLabel = new System.Windows.Forms.Label();
42 | this.label5 = new System.Windows.Forms.Label();
43 | this.samplingModeComboBox = new System.Windows.Forms.ComboBox();
44 | this.rxVga1GainTrackBar = new System.Windows.Forms.TrackBar();
45 | this.rxVga1gainLabel = new System.Windows.Forms.Label();
46 | this.label6 = new System.Windows.Forms.Label();
47 | this.lnaGainLabel = new System.Windows.Forms.Label();
48 | this.label7 = new System.Windows.Forms.Label();
49 | this.lnaGainTrackBar = new System.Windows.Forms.TrackBar();
50 | this.fpgaOpenFileDialog = new System.Windows.Forms.OpenFileDialog();
51 | this.fpgaTextBox = new System.Windows.Forms.TextBox();
52 | this.fpgaButton = new System.Windows.Forms.Button();
53 | this.label4 = new System.Windows.Forms.Label();
54 | this.labelVersion = new System.Windows.Forms.Label();
55 | this.xb200Checkbox = new System.Windows.Forms.CheckBox();
56 | this.xb200FilterCombobox = new System.Windows.Forms.ComboBox();
57 | this.groupBox1 = new System.Windows.Forms.GroupBox();
58 | this.label8 = new System.Windows.Forms.Label();
59 | this.label9 = new System.Windows.Forms.Label();
60 | this.bandwidthComboBox = new System.Windows.Forms.ComboBox();
61 | this.groupBox2 = new System.Windows.Forms.GroupBox();
62 | ((System.ComponentModel.ISupportInitialize)(this.rxVga2GainTrackBar)).BeginInit();
63 | ((System.ComponentModel.ISupportInitialize)(this.rxVga1GainTrackBar)).BeginInit();
64 | ((System.ComponentModel.ISupportInitialize)(this.lnaGainTrackBar)).BeginInit();
65 | this.groupBox1.SuspendLayout();
66 | this.groupBox2.SuspendLayout();
67 | this.SuspendLayout();
68 | //
69 | // refreshTimer
70 | //
71 | this.refreshTimer.Interval = 1000;
72 | this.refreshTimer.Tick += new System.EventHandler(this.refreshTimer_Tick);
73 | //
74 | // closeButton
75 | //
76 | this.closeButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
77 | this.closeButton.Location = new System.Drawing.Point(183, 517);
78 | this.closeButton.Name = "closeButton";
79 | this.closeButton.Size = new System.Drawing.Size(75, 23);
80 | this.closeButton.TabIndex = 8;
81 | this.closeButton.Text = "Close";
82 | this.closeButton.UseVisualStyleBackColor = true;
83 | this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
84 | //
85 | // deviceComboBox
86 | //
87 | this.deviceComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
88 | this.deviceComboBox.FormattingEnabled = true;
89 | this.deviceComboBox.Location = new System.Drawing.Point(12, 26);
90 | this.deviceComboBox.Name = "deviceComboBox";
91 | this.deviceComboBox.Size = new System.Drawing.Size(247, 21);
92 | this.deviceComboBox.TabIndex = 0;
93 | this.deviceComboBox.SelectedIndexChanged += new System.EventHandler(this.deviceComboBox_SelectedIndexChanged);
94 | //
95 | // label1
96 | //
97 | this.label1.AutoSize = true;
98 | this.label1.Location = new System.Drawing.Point(12, 9);
99 | this.label1.Name = "label1";
100 | this.label1.Size = new System.Drawing.Size(41, 13);
101 | this.label1.TabIndex = 20;
102 | this.label1.Text = "Device";
103 | //
104 | // rxVga2GainTrackBar
105 | //
106 | this.rxVga2GainTrackBar.LargeChange = 3;
107 | this.rxVga2GainTrackBar.Location = new System.Drawing.Point(14, 133);
108 | this.rxVga2GainTrackBar.Maximum = 30;
109 | this.rxVga2GainTrackBar.Name = "rxVga2GainTrackBar";
110 | this.rxVga2GainTrackBar.Size = new System.Drawing.Size(216, 45);
111 | this.rxVga2GainTrackBar.SmallChange = 3;
112 | this.rxVga2GainTrackBar.TabIndex = 6;
113 | this.rxVga2GainTrackBar.Value = 20;
114 | this.rxVga2GainTrackBar.Scroll += new System.EventHandler(this.rxVga2GainTrackBar_Scroll);
115 | //
116 | // label2
117 | //
118 | this.label2.AutoSize = true;
119 | this.label2.Location = new System.Drawing.Point(11, 117);
120 | this.label2.Name = "label2";
121 | this.label2.Size = new System.Drawing.Size(73, 13);
122 | this.label2.TabIndex = 22;
123 | this.label2.Text = "RxVGA2 Gain";
124 | //
125 | // label3
126 | //
127 | this.label3.AutoSize = true;
128 | this.label3.Location = new System.Drawing.Point(12, 107);
129 | this.label3.Name = "label3";
130 | this.label3.Size = new System.Drawing.Size(68, 13);
131 | this.label3.TabIndex = 24;
132 | this.label3.Text = "Sample Rate";
133 | //
134 | // samplerateComboBox
135 | //
136 | this.samplerateComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
137 | this.samplerateComboBox.FormattingEnabled = true;
138 | this.samplerateComboBox.Location = new System.Drawing.Point(12, 124);
139 | this.samplerateComboBox.Name = "samplerateComboBox";
140 | this.samplerateComboBox.Size = new System.Drawing.Size(103, 21);
141 | this.samplerateComboBox.TabIndex = 1;
142 | this.samplerateComboBox.SelectedIndexChanged += new System.EventHandler(this.samplerateComboBox_SelectedIndexChanged);
143 | //
144 | // rxVga2gainLabel
145 | //
146 | this.rxVga2gainLabel.Location = new System.Drawing.Point(162, 119);
147 | this.rxVga2gainLabel.Name = "rxVga2gainLabel";
148 | this.rxVga2gainLabel.Size = new System.Drawing.Size(68, 13);
149 | this.rxVga2gainLabel.TabIndex = 26;
150 | this.rxVga2gainLabel.Text = "0dB";
151 | this.rxVga2gainLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
152 | //
153 | // bladeRFTypeLabel
154 | //
155 | this.bladeRFTypeLabel.Location = new System.Drawing.Point(75, 9);
156 | this.bladeRFTypeLabel.Name = "bladeRFTypeLabel";
157 | this.bladeRFTypeLabel.Size = new System.Drawing.Size(184, 13);
158 | this.bladeRFTypeLabel.TabIndex = 29;
159 | this.bladeRFTypeLabel.Text = "BladeRF";
160 | this.bladeRFTypeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
161 | //
162 | // label5
163 | //
164 | this.label5.AutoSize = true;
165 | this.label5.Location = new System.Drawing.Point(12, 57);
166 | this.label5.Name = "label5";
167 | this.label5.Size = new System.Drawing.Size(80, 13);
168 | this.label5.TabIndex = 31;
169 | this.label5.Text = "Sampling Mode";
170 | //
171 | // samplingModeComboBox
172 | //
173 | this.samplingModeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
174 | this.samplingModeComboBox.FormattingEnabled = true;
175 | this.samplingModeComboBox.Items.AddRange(new object[] {
176 | "Unknown",
177 | "RX/TX SMA",
178 | "J60/J61 connectors"});
179 | this.samplingModeComboBox.Location = new System.Drawing.Point(12, 74);
180 | this.samplingModeComboBox.Name = "samplingModeComboBox";
181 | this.samplingModeComboBox.Size = new System.Drawing.Size(247, 21);
182 | this.samplingModeComboBox.TabIndex = 2;
183 | this.samplingModeComboBox.SelectedIndexChanged += new System.EventHandler(this.samplingModeComboBox_SelectedIndexChanged);
184 | //
185 | // rxVga1GainTrackBar
186 | //
187 | this.rxVga1GainTrackBar.LargeChange = 1;
188 | this.rxVga1GainTrackBar.Location = new System.Drawing.Point(14, 81);
189 | this.rxVga1GainTrackBar.Maximum = 30;
190 | this.rxVga1GainTrackBar.Minimum = 5;
191 | this.rxVga1GainTrackBar.Name = "rxVga1GainTrackBar";
192 | this.rxVga1GainTrackBar.Size = new System.Drawing.Size(216, 45);
193 | this.rxVga1GainTrackBar.TabIndex = 32;
194 | this.rxVga1GainTrackBar.Value = 20;
195 | this.rxVga1GainTrackBar.Scroll += new System.EventHandler(this.rxVga1GainTrackBar_Scroll);
196 | //
197 | // rxVga1gainLabel
198 | //
199 | this.rxVga1gainLabel.Location = new System.Drawing.Point(162, 65);
200 | this.rxVga1gainLabel.Name = "rxVga1gainLabel";
201 | this.rxVga1gainLabel.Size = new System.Drawing.Size(68, 13);
202 | this.rxVga1gainLabel.TabIndex = 34;
203 | this.rxVga1gainLabel.Text = "5dB";
204 | this.rxVga1gainLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
205 | //
206 | // label6
207 | //
208 | this.label6.AutoSize = true;
209 | this.label6.Location = new System.Drawing.Point(11, 65);
210 | this.label6.Name = "label6";
211 | this.label6.Size = new System.Drawing.Size(73, 13);
212 | this.label6.TabIndex = 33;
213 | this.label6.Text = "RxVGA1 Gain";
214 | //
215 | // lnaGainLabel
216 | //
217 | this.lnaGainLabel.Location = new System.Drawing.Point(162, 15);
218 | this.lnaGainLabel.Name = "lnaGainLabel";
219 | this.lnaGainLabel.Size = new System.Drawing.Size(68, 13);
220 | this.lnaGainLabel.TabIndex = 37;
221 | this.lnaGainLabel.Text = "3dB";
222 | this.lnaGainLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
223 | //
224 | // label7
225 | //
226 | this.label7.AutoSize = true;
227 | this.label7.Location = new System.Drawing.Point(11, 15);
228 | this.label7.Name = "label7";
229 | this.label7.Size = new System.Drawing.Size(53, 13);
230 | this.label7.TabIndex = 36;
231 | this.label7.Text = "LNA Gain";
232 | //
233 | // lnaGainTrackBar
234 | //
235 | this.lnaGainTrackBar.LargeChange = 1;
236 | this.lnaGainTrackBar.Location = new System.Drawing.Point(14, 31);
237 | this.lnaGainTrackBar.Maximum = 3;
238 | this.lnaGainTrackBar.Minimum = 1;
239 | this.lnaGainTrackBar.Name = "lnaGainTrackBar";
240 | this.lnaGainTrackBar.Size = new System.Drawing.Size(216, 45);
241 | this.lnaGainTrackBar.TabIndex = 35;
242 | this.lnaGainTrackBar.Value = 2;
243 | this.lnaGainTrackBar.Scroll += new System.EventHandler(this.lnaGainTrackBar_Scroll);
244 | //
245 | // fpgaOpenFileDialog
246 | //
247 | this.fpgaOpenFileDialog.AddExtension = false;
248 | this.fpgaOpenFileDialog.FileName = "openFileDialog1";
249 | this.fpgaOpenFileDialog.Filter = "rbf files|*.rbf";
250 | this.fpgaOpenFileDialog.ReadOnlyChecked = true;
251 | this.fpgaOpenFileDialog.Title = "Choose FPGA file";
252 | //
253 | // fpgaTextBox
254 | //
255 | this.fpgaTextBox.Location = new System.Drawing.Point(11, 476);
256 | this.fpgaTextBox.Name = "fpgaTextBox";
257 | this.fpgaTextBox.ReadOnly = true;
258 | this.fpgaTextBox.Size = new System.Drawing.Size(160, 20);
259 | this.fpgaTextBox.TabIndex = 38;
260 | //
261 | // fpgaButton
262 | //
263 | this.fpgaButton.Location = new System.Drawing.Point(183, 474);
264 | this.fpgaButton.Name = "fpgaButton";
265 | this.fpgaButton.Size = new System.Drawing.Size(75, 23);
266 | this.fpgaButton.TabIndex = 39;
267 | this.fpgaButton.Text = "Browse...";
268 | this.fpgaButton.UseVisualStyleBackColor = true;
269 | this.fpgaButton.Click += new System.EventHandler(this.fpgaButton_Click);
270 | //
271 | // label4
272 | //
273 | this.label4.AutoSize = true;
274 | this.label4.Location = new System.Drawing.Point(11, 455);
275 | this.label4.Name = "label4";
276 | this.label4.Size = new System.Drawing.Size(54, 13);
277 | this.label4.TabIndex = 40;
278 | this.label4.Text = "FPGA File";
279 | //
280 | // labelVersion
281 | //
282 | this.labelVersion.Location = new System.Drawing.Point(8, 517);
283 | this.labelVersion.Name = "labelVersion";
284 | this.labelVersion.Size = new System.Drawing.Size(168, 23);
285 | this.labelVersion.TabIndex = 41;
286 | //
287 | // xb200Checkbox
288 | //
289 | this.xb200Checkbox.AutoSize = true;
290 | this.xb200Checkbox.Location = new System.Drawing.Point(6, 23);
291 | this.xb200Checkbox.Name = "xb200Checkbox";
292 | this.xb200Checkbox.Size = new System.Drawing.Size(184, 17);
293 | this.xb200Checkbox.TabIndex = 42;
294 | this.xb200Checkbox.Text = "Enable XB-200 Transverter board";
295 | this.xb200Checkbox.UseVisualStyleBackColor = true;
296 | this.xb200Checkbox.CheckedChanged += new System.EventHandler(this.xb200Checkbox_CheckedChanged);
297 | //
298 | // xb200FilterCombobox
299 | //
300 | this.xb200FilterCombobox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
301 | this.xb200FilterCombobox.Enabled = false;
302 | this.xb200FilterCombobox.FormattingEnabled = true;
303 | this.xb200FilterCombobox.Location = new System.Drawing.Point(6, 64);
304 | this.xb200FilterCombobox.Name = "xb200FilterCombobox";
305 | this.xb200FilterCombobox.Size = new System.Drawing.Size(235, 21);
306 | this.xb200FilterCombobox.TabIndex = 43;
307 | this.xb200FilterCombobox.SelectedIndexChanged += new System.EventHandler(this.xb200FilterCombobox_SelectedIndexChanged);
308 | //
309 | // groupBox1
310 | //
311 | this.groupBox1.Controls.Add(this.label8);
312 | this.groupBox1.Controls.Add(this.xb200Checkbox);
313 | this.groupBox1.Controls.Add(this.xb200FilterCombobox);
314 | this.groupBox1.Location = new System.Drawing.Point(12, 347);
315 | this.groupBox1.Name = "groupBox1";
316 | this.groupBox1.Size = new System.Drawing.Size(247, 100);
317 | this.groupBox1.TabIndex = 44;
318 | this.groupBox1.TabStop = false;
319 | this.groupBox1.Text = "XB-200 configuration";
320 | //
321 | // label8
322 | //
323 | this.label8.AutoSize = true;
324 | this.label8.Location = new System.Drawing.Point(6, 48);
325 | this.label8.Name = "label8";
326 | this.label8.Size = new System.Drawing.Size(56, 13);
327 | this.label8.TabIndex = 44;
328 | this.label8.Text = "Filter bank";
329 | //
330 | // label9
331 | //
332 | this.label9.AutoSize = true;
333 | this.label9.Location = new System.Drawing.Point(131, 107);
334 | this.label9.Name = "label9";
335 | this.label9.Size = new System.Drawing.Size(57, 13);
336 | this.label9.TabIndex = 46;
337 | this.label9.Text = "Bandwidth";
338 | //
339 | // bandwidthComboBox
340 | //
341 | this.bandwidthComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
342 | this.bandwidthComboBox.FormattingEnabled = true;
343 | this.bandwidthComboBox.Location = new System.Drawing.Point(134, 124);
344 | this.bandwidthComboBox.Name = "bandwidthComboBox";
345 | this.bandwidthComboBox.Size = new System.Drawing.Size(125, 21);
346 | this.bandwidthComboBox.TabIndex = 45;
347 | this.bandwidthComboBox.SelectedIndexChanged += new System.EventHandler(this.bandwidthComboBox_SelectedIndexChanged);
348 | //
349 | // groupBox2
350 | //
351 | this.groupBox2.Controls.Add(this.label7);
352 | this.groupBox2.Controls.Add(this.lnaGainLabel);
353 | this.groupBox2.Controls.Add(this.label2);
354 | this.groupBox2.Controls.Add(this.rxVga2gainLabel);
355 | this.groupBox2.Controls.Add(this.label6);
356 | this.groupBox2.Controls.Add(this.rxVga1gainLabel);
357 | this.groupBox2.Controls.Add(this.lnaGainTrackBar);
358 | this.groupBox2.Controls.Add(this.rxVga1GainTrackBar);
359 | this.groupBox2.Controls.Add(this.rxVga2GainTrackBar);
360 | this.groupBox2.Location = new System.Drawing.Point(12, 156);
361 | this.groupBox2.Name = "groupBox2";
362 | this.groupBox2.Size = new System.Drawing.Size(247, 185);
363 | this.groupBox2.TabIndex = 47;
364 | this.groupBox2.TabStop = false;
365 | this.groupBox2.Text = "Gain controls";
366 | //
367 | // BladeRFControllerDialog
368 | //
369 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
370 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
371 | this.CancelButton = this.closeButton;
372 | this.ClientSize = new System.Drawing.Size(272, 552);
373 | this.Controls.Add(this.groupBox2);
374 | this.Controls.Add(this.label9);
375 | this.Controls.Add(this.bandwidthComboBox);
376 | this.Controls.Add(this.groupBox1);
377 | this.Controls.Add(this.labelVersion);
378 | this.Controls.Add(this.label4);
379 | this.Controls.Add(this.fpgaButton);
380 | this.Controls.Add(this.fpgaTextBox);
381 | this.Controls.Add(this.label5);
382 | this.Controls.Add(this.samplingModeComboBox);
383 | this.Controls.Add(this.bladeRFTypeLabel);
384 | this.Controls.Add(this.label3);
385 | this.Controls.Add(this.samplerateComboBox);
386 | this.Controls.Add(this.label1);
387 | this.Controls.Add(this.deviceComboBox);
388 | this.Controls.Add(this.closeButton);
389 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
390 | this.MaximizeBox = false;
391 | this.MinimizeBox = false;
392 | this.Name = "BladeRFControllerDialog";
393 | this.ShowIcon = false;
394 | this.ShowInTaskbar = false;
395 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
396 | this.Text = "BladeRF Controller";
397 | this.TopMost = true;
398 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BladeRFControllerDialog_FormClosing);
399 | this.VisibleChanged += new System.EventHandler(this.BladeRFControllerDialog_VisibleChanged);
400 | ((System.ComponentModel.ISupportInitialize)(this.rxVga2GainTrackBar)).EndInit();
401 | ((System.ComponentModel.ISupportInitialize)(this.rxVga1GainTrackBar)).EndInit();
402 | ((System.ComponentModel.ISupportInitialize)(this.lnaGainTrackBar)).EndInit();
403 | this.groupBox1.ResumeLayout(false);
404 | this.groupBox1.PerformLayout();
405 | this.groupBox2.ResumeLayout(false);
406 | this.groupBox2.PerformLayout();
407 | this.ResumeLayout(false);
408 | this.PerformLayout();
409 |
410 | }
411 |
412 | #endregion
413 |
414 | private System.Windows.Forms.Timer refreshTimer;
415 | private System.Windows.Forms.Button closeButton;
416 | private System.Windows.Forms.ComboBox deviceComboBox;
417 | private System.Windows.Forms.Label label1;
418 | private System.Windows.Forms.TrackBar rxVga2GainTrackBar;
419 | private System.Windows.Forms.Label label2;
420 | private System.Windows.Forms.Label label3;
421 | private System.Windows.Forms.ComboBox samplerateComboBox;
422 | private System.Windows.Forms.Label rxVga2gainLabel;
423 | private System.Windows.Forms.Label bladeRFTypeLabel;
424 | private System.Windows.Forms.Label label5;
425 | private System.Windows.Forms.ComboBox samplingModeComboBox;
426 | private System.Windows.Forms.TrackBar rxVga1GainTrackBar;
427 | private System.Windows.Forms.Label rxVga1gainLabel;
428 | private System.Windows.Forms.Label label6;
429 | private System.Windows.Forms.Label lnaGainLabel;
430 | private System.Windows.Forms.Label label7;
431 | private System.Windows.Forms.TrackBar lnaGainTrackBar;
432 | private System.Windows.Forms.OpenFileDialog fpgaOpenFileDialog;
433 | private System.Windows.Forms.TextBox fpgaTextBox;
434 | private System.Windows.Forms.Button fpgaButton;
435 | private System.Windows.Forms.Label label4;
436 | private System.Windows.Forms.Label labelVersion;
437 | private System.Windows.Forms.CheckBox xb200Checkbox;
438 | private System.Windows.Forms.ComboBox xb200FilterCombobox;
439 | private System.Windows.Forms.GroupBox groupBox1;
440 | private System.Windows.Forms.Label label8;
441 | private System.Windows.Forms.Label label9;
442 | private System.Windows.Forms.ComboBox bandwidthComboBox;
443 | private System.Windows.Forms.GroupBox groupBox2;
444 | }
445 | }
446 |
447 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/pthreads-win32/COPYING.LIB.txt:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 2.1, February 1999
3 |
4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | [This is the first released version of the Lesser GPL. It also counts
10 | as the successor of the GNU Library Public License, version 2, hence
11 | the version number 2.1.]
12 |
13 | Preamble
14 |
15 | The licenses for most software are designed to take away your
16 | freedom to share and change it. By contrast, the GNU General Public
17 | Licenses are intended to guarantee your freedom to share and change
18 | free software--to make sure the software is free for all its users.
19 |
20 | This license, the Lesser General Public License, applies to some
21 | specially designated software packages--typically libraries--of the
22 | Free Software Foundation and other authors who decide to use it. You
23 | can use it too, but we suggest you first think carefully about whether
24 | this license or the ordinary General Public License is the better
25 | strategy to use in any particular case, based on the explanations below.
26 |
27 | When we speak of free software, we are referring to freedom of use,
28 | not price. Our General Public Licenses are designed to make sure that
29 | you have the freedom to distribute copies of free software (and charge
30 | for this service if you wish); that you receive source code or can get
31 | it if you want it; that you can change the software and use pieces of
32 | it in new free programs; and that you are informed that you can do
33 | these things.
34 |
35 | To protect your rights, we need to make restrictions that forbid
36 | distributors to deny you these rights or to ask you to surrender these
37 | rights. These restrictions translate to certain responsibilities for
38 | you if you distribute copies of the library or if you modify it.
39 |
40 | For example, if you distribute copies of the library, whether gratis
41 | or for a fee, you must give the recipients all the rights that we gave
42 | you. You must make sure that they, too, receive or can get the source
43 | code. If you link other code with the library, you must provide
44 | complete object files to the recipients, so that they can relink them
45 | with the library after making changes to the library and recompiling
46 | it. And you must show them these terms so they know their rights.
47 |
48 | We protect your rights with a two-step method: (1) we copyright the
49 | library, and (2) we offer you this license, which gives you legal
50 | permission to copy, distribute and/or modify the library.
51 |
52 | To protect each distributor, we want to make it very clear that
53 | there is no warranty for the free library. Also, if the library is
54 | modified by someone else and passed on, the recipients should know
55 | that what they have is not the original version, so that the original
56 | author's reputation will not be affected by problems that might be
57 | introduced by others.
58 |
59 | Finally, software patents pose a constant threat to the existence of
60 | any free program. We wish to make sure that a company cannot
61 | effectively restrict the users of a free program by obtaining a
62 | restrictive license from a patent holder. Therefore, we insist that
63 | any patent license obtained for a version of the library must be
64 | consistent with the full freedom of use specified in this license.
65 |
66 | Most GNU software, including some libraries, is covered by the
67 | ordinary GNU General Public License. This license, the GNU Lesser
68 | General Public License, applies to certain designated libraries, and
69 | is quite different from the ordinary General Public License. We use
70 | this license for certain libraries in order to permit linking those
71 | libraries into non-free programs.
72 |
73 | When a program is linked with a library, whether statically or using
74 | a shared library, the combination of the two is legally speaking a
75 | combined work, a derivative of the original library. The ordinary
76 | General Public License therefore permits such linking only if the
77 | entire combination fits its criteria of freedom. The Lesser General
78 | Public License permits more lax criteria for linking other code with
79 | the library.
80 |
81 | We call this license the "Lesser" General Public License because it
82 | does Less to protect the user's freedom than the ordinary General
83 | Public License. It also provides other free software developers Less
84 | of an advantage over competing non-free programs. These disadvantages
85 | are the reason we use the ordinary General Public License for many
86 | libraries. However, the Lesser license provides advantages in certain
87 | special circumstances.
88 |
89 | For example, on rare occasions, there may be a special need to
90 | encourage the widest possible use of a certain library, so that it becomes
91 | a de-facto standard. To achieve this, non-free programs must be
92 | allowed to use the library. A more frequent case is that a free
93 | library does the same job as widely used non-free libraries. In this
94 | case, there is little to gain by limiting the free library to free
95 | software only, so we use the Lesser General Public License.
96 |
97 | In other cases, permission to use a particular library in non-free
98 | programs enables a greater number of people to use a large body of
99 | free software. For example, permission to use the GNU C Library in
100 | non-free programs enables many more people to use the whole GNU
101 | operating system, as well as its variant, the GNU/Linux operating
102 | system.
103 |
104 | Although the Lesser General Public License is Less protective of the
105 | users' freedom, it does ensure that the user of a program that is
106 | linked with the Library has the freedom and the wherewithal to run
107 | that program using a modified version of the Library.
108 |
109 | The precise terms and conditions for copying, distribution and
110 | modification follow. Pay close attention to the difference between a
111 | "work based on the library" and a "work that uses the library". The
112 | former contains code derived from the library, whereas the latter must
113 | be combined with the library in order to run.
114 |
115 | GNU LESSER GENERAL PUBLIC LICENSE
116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117 |
118 | 0. This License Agreement applies to any software library or other
119 | program which contains a notice placed by the copyright holder or
120 | other authorized party saying it may be distributed under the terms of
121 | this Lesser General Public License (also called "this License").
122 | Each licensee is addressed as "you".
123 |
124 | A "library" means a collection of software functions and/or data
125 | prepared so as to be conveniently linked with application programs
126 | (which use some of those functions and data) to form executables.
127 |
128 | The "Library", below, refers to any such software library or work
129 | which has been distributed under these terms. A "work based on the
130 | Library" means either the Library or any derivative work under
131 | copyright law: that is to say, a work containing the Library or a
132 | portion of it, either verbatim or with modifications and/or translated
133 | straightforwardly into another language. (Hereinafter, translation is
134 | included without limitation in the term "modification".)
135 |
136 | "Source code" for a work means the preferred form of the work for
137 | making modifications to it. For a library, complete source code means
138 | all the source code for all modules it contains, plus any associated
139 | interface definition files, plus the scripts used to control compilation
140 | and installation of the library.
141 |
142 | Activities other than copying, distribution and modification are not
143 | covered by this License; they are outside its scope. The act of
144 | running a program using the Library is not restricted, and output from
145 | such a program is covered only if its contents constitute a work based
146 | on the Library (independent of the use of the Library in a tool for
147 | writing it). Whether that is true depends on what the Library does
148 | and what the program that uses the Library does.
149 |
150 | 1. You may copy and distribute verbatim copies of the Library's
151 | complete source code as you receive it, in any medium, provided that
152 | you conspicuously and appropriately publish on each copy an
153 | appropriate copyright notice and disclaimer of warranty; keep intact
154 | all the notices that refer to this License and to the absence of any
155 | warranty; and distribute a copy of this License along with the
156 | Library.
157 |
158 | You may charge a fee for the physical act of transferring a copy,
159 | and you may at your option offer warranty protection in exchange for a
160 | fee.
161 |
162 | 2. You may modify your copy or copies of the Library or any portion
163 | of it, thus forming a work based on the Library, and copy and
164 | distribute such modifications or work under the terms of Section 1
165 | above, provided that you also meet all of these conditions:
166 |
167 | a) The modified work must itself be a software library.
168 |
169 | b) You must cause the files modified to carry prominent notices
170 | stating that you changed the files and the date of any change.
171 |
172 | c) You must cause the whole of the work to be licensed at no
173 | charge to all third parties under the terms of this License.
174 |
175 | d) If a facility in the modified Library refers to a function or a
176 | table of data to be supplied by an application program that uses
177 | the facility, other than as an argument passed when the facility
178 | is invoked, then you must make a good faith effort to ensure that,
179 | in the event an application does not supply such function or
180 | table, the facility still operates, and performs whatever part of
181 | its purpose remains meaningful.
182 |
183 | (For example, a function in a library to compute square roots has
184 | a purpose that is entirely well-defined independent of the
185 | application. Therefore, Subsection 2d requires that any
186 | application-supplied function or table used by this function must
187 | be optional: if the application does not supply it, the square
188 | root function must still compute square roots.)
189 |
190 | These requirements apply to the modified work as a whole. If
191 | identifiable sections of that work are not derived from the Library,
192 | and can be reasonably considered independent and separate works in
193 | themselves, then this License, and its terms, do not apply to those
194 | sections when you distribute them as separate works. But when you
195 | distribute the same sections as part of a whole which is a work based
196 | on the Library, the distribution of the whole must be on the terms of
197 | this License, whose permissions for other licensees extend to the
198 | entire whole, and thus to each and every part regardless of who wrote
199 | it.
200 |
201 | Thus, it is not the intent of this section to claim rights or contest
202 | your rights to work written entirely by you; rather, the intent is to
203 | exercise the right to control the distribution of derivative or
204 | collective works based on the Library.
205 |
206 | In addition, mere aggregation of another work not based on the Library
207 | with the Library (or with a work based on the Library) on a volume of
208 | a storage or distribution medium does not bring the other work under
209 | the scope of this License.
210 |
211 | 3. You may opt to apply the terms of the ordinary GNU General Public
212 | License instead of this License to a given copy of the Library. To do
213 | this, you must alter all the notices that refer to this License, so
214 | that they refer to the ordinary GNU General Public License, version 2,
215 | instead of to this License. (If a newer version than version 2 of the
216 | ordinary GNU General Public License has appeared, then you can specify
217 | that version instead if you wish.) Do not make any other change in
218 | these notices.
219 |
220 | Once this change is made in a given copy, it is irreversible for
221 | that copy, so the ordinary GNU General Public License applies to all
222 | subsequent copies and derivative works made from that copy.
223 |
224 | This option is useful when you wish to copy part of the code of
225 | the Library into a program that is not a library.
226 |
227 | 4. You may copy and distribute the Library (or a portion or
228 | derivative of it, under Section 2) in object code or executable form
229 | under the terms of Sections 1 and 2 above provided that you accompany
230 | it with the complete corresponding machine-readable source code, which
231 | must be distributed under the terms of Sections 1 and 2 above on a
232 | medium customarily used for software interchange.
233 |
234 | If distribution of object code is made by offering access to copy
235 | from a designated place, then offering equivalent access to copy the
236 | source code from the same place satisfies the requirement to
237 | distribute the source code, even though third parties are not
238 | compelled to copy the source along with the object code.
239 |
240 | 5. A program that contains no derivative of any portion of the
241 | Library, but is designed to work with the Library by being compiled or
242 | linked with it, is called a "work that uses the Library". Such a
243 | work, in isolation, is not a derivative work of the Library, and
244 | therefore falls outside the scope of this License.
245 |
246 | However, linking a "work that uses the Library" with the Library
247 | creates an executable that is a derivative of the Library (because it
248 | contains portions of the Library), rather than a "work that uses the
249 | library". The executable is therefore covered by this License.
250 | Section 6 states terms for distribution of such executables.
251 |
252 | When a "work that uses the Library" uses material from a header file
253 | that is part of the Library, the object code for the work may be a
254 | derivative work of the Library even though the source code is not.
255 | Whether this is true is especially significant if the work can be
256 | linked without the Library, or if the work is itself a library. The
257 | threshold for this to be true is not precisely defined by law.
258 |
259 | If such an object file uses only numerical parameters, data
260 | structure layouts and accessors, and small macros and small inline
261 | functions (ten lines or less in length), then the use of the object
262 | file is unrestricted, regardless of whether it is legally a derivative
263 | work. (Executables containing this object code plus portions of the
264 | Library will still fall under Section 6.)
265 |
266 | Otherwise, if the work is a derivative of the Library, you may
267 | distribute the object code for the work under the terms of Section 6.
268 | Any executables containing that work also fall under Section 6,
269 | whether or not they are linked directly with the Library itself.
270 |
271 | 6. As an exception to the Sections above, you may also combine or
272 | link a "work that uses the Library" with the Library to produce a
273 | work containing portions of the Library, and distribute that work
274 | under terms of your choice, provided that the terms permit
275 | modification of the work for the customer's own use and reverse
276 | engineering for debugging such modifications.
277 |
278 | You must give prominent notice with each copy of the work that the
279 | Library is used in it and that the Library and its use are covered by
280 | this License. You must supply a copy of this License. If the work
281 | during execution displays copyright notices, you must include the
282 | copyright notice for the Library among them, as well as a reference
283 | directing the user to the copy of this License. Also, you must do one
284 | of these things:
285 |
286 | a) Accompany the work with the complete corresponding
287 | machine-readable source code for the Library including whatever
288 | changes were used in the work (which must be distributed under
289 | Sections 1 and 2 above); and, if the work is an executable linked
290 | with the Library, with the complete machine-readable "work that
291 | uses the Library", as object code and/or source code, so that the
292 | user can modify the Library and then relink to produce a modified
293 | executable containing the modified Library. (It is understood
294 | that the user who changes the contents of definitions files in the
295 | Library will not necessarily be able to recompile the application
296 | to use the modified definitions.)
297 |
298 | b) Use a suitable shared library mechanism for linking with the
299 | Library. A suitable mechanism is one that (1) uses at run time a
300 | copy of the library already present on the user's computer system,
301 | rather than copying library functions into the executable, and (2)
302 | will operate properly with a modified version of the library, if
303 | the user installs one, as long as the modified version is
304 | interface-compatible with the version that the work was made with.
305 |
306 | c) Accompany the work with a written offer, valid for at
307 | least three years, to give the same user the materials
308 | specified in Subsection 6a, above, for a charge no more
309 | than the cost of performing this distribution.
310 |
311 | d) If distribution of the work is made by offering access to copy
312 | from a designated place, offer equivalent access to copy the above
313 | specified materials from the same place.
314 |
315 | e) Verify that the user has already received a copy of these
316 | materials or that you have already sent this user a copy.
317 |
318 | For an executable, the required form of the "work that uses the
319 | Library" must include any data and utility programs needed for
320 | reproducing the executable from it. However, as a special exception,
321 | the materials to be distributed need not include anything that is
322 | normally distributed (in either source or binary form) with the major
323 | components (compiler, kernel, and so on) of the operating system on
324 | which the executable runs, unless that component itself accompanies
325 | the executable.
326 |
327 | It may happen that this requirement contradicts the license
328 | restrictions of other proprietary libraries that do not normally
329 | accompany the operating system. Such a contradiction means you cannot
330 | use both them and the Library together in an executable that you
331 | distribute.
332 |
333 | 7. You may place library facilities that are a work based on the
334 | Library side-by-side in a single library together with other library
335 | facilities not covered by this License, and distribute such a combined
336 | library, provided that the separate distribution of the work based on
337 | the Library and of the other library facilities is otherwise
338 | permitted, and provided that you do these two things:
339 |
340 | a) Accompany the combined library with a copy of the same work
341 | based on the Library, uncombined with any other library
342 | facilities. This must be distributed under the terms of the
343 | Sections above.
344 |
345 | b) Give prominent notice with the combined library of the fact
346 | that part of it is a work based on the Library, and explaining
347 | where to find the accompanying uncombined form of the same work.
348 |
349 | 8. You may not copy, modify, sublicense, link with, or distribute
350 | the Library except as expressly provided under this License. Any
351 | attempt otherwise to copy, modify, sublicense, link with, or
352 | distribute the Library is void, and will automatically terminate your
353 | rights under this License. However, parties who have received copies,
354 | or rights, from you under this License will not have their licenses
355 | terminated so long as such parties remain in full compliance.
356 |
357 | 9. You are not required to accept this License, since you have not
358 | signed it. However, nothing else grants you permission to modify or
359 | distribute the Library or its derivative works. These actions are
360 | prohibited by law if you do not accept this License. Therefore, by
361 | modifying or distributing the Library (or any work based on the
362 | Library), you indicate your acceptance of this License to do so, and
363 | all its terms and conditions for copying, distributing or modifying
364 | the Library or works based on it.
365 |
366 | 10. Each time you redistribute the Library (or any work based on the
367 | Library), the recipient automatically receives a license from the
368 | original licensor to copy, distribute, link with or modify the Library
369 | subject to these terms and conditions. You may not impose any further
370 | restrictions on the recipients' exercise of the rights granted herein.
371 | You are not responsible for enforcing compliance by third parties with
372 | this License.
373 |
374 | 11. If, as a consequence of a court judgment or allegation of patent
375 | infringement or for any other reason (not limited to patent issues),
376 | conditions are imposed on you (whether by court order, agreement or
377 | otherwise) that contradict the conditions of this License, they do not
378 | excuse you from the conditions of this License. If you cannot
379 | distribute so as to satisfy simultaneously your obligations under this
380 | License and any other pertinent obligations, then as a consequence you
381 | may not distribute the Library at all. For example, if a patent
382 | license would not permit royalty-free redistribution of the Library by
383 | all those who receive copies directly or indirectly through you, then
384 | the only way you could satisfy both it and this License would be to
385 | refrain entirely from distribution of the Library.
386 |
387 | If any portion of this section is held invalid or unenforceable under any
388 | particular circumstance, the balance of the section is intended to apply,
389 | and the section as a whole is intended to apply in other circumstances.
390 |
391 | It is not the purpose of this section to induce you to infringe any
392 | patents or other property right claims or to contest validity of any
393 | such claims; this section has the sole purpose of protecting the
394 | integrity of the free software distribution system which is
395 | implemented by public license practices. Many people have made
396 | generous contributions to the wide range of software distributed
397 | through that system in reliance on consistent application of that
398 | system; it is up to the author/donor to decide if he or she is willing
399 | to distribute software through any other system and a licensee cannot
400 | impose that choice.
401 |
402 | This section is intended to make thoroughly clear what is believed to
403 | be a consequence of the rest of this License.
404 |
405 | 12. If the distribution and/or use of the Library is restricted in
406 | certain countries either by patents or by copyrighted interfaces, the
407 | original copyright holder who places the Library under this License may add
408 | an explicit geographical distribution limitation excluding those countries,
409 | so that distribution is permitted only in or among countries not thus
410 | excluded. In such case, this License incorporates the limitation as if
411 | written in the body of this License.
412 |
413 | 13. The Free Software Foundation may publish revised and/or new
414 | versions of the Lesser General Public License from time to time.
415 | Such new versions will be similar in spirit to the present version,
416 | but may differ in detail to address new problems or concerns.
417 |
418 | Each version is given a distinguishing version number. If the Library
419 | specifies a version number of this License which applies to it and
420 | "any later version", you have the option of following the terms and
421 | conditions either of that version or of any later version published by
422 | the Free Software Foundation. If the Library does not specify a
423 | license version number, you may choose any version ever published by
424 | the Free Software Foundation.
425 |
426 | 14. If you wish to incorporate parts of the Library into other free
427 | programs whose distribution conditions are incompatible with these,
428 | write to the author to ask for permission. For software which is
429 | copyrighted by the Free Software Foundation, write to the Free
430 | Software Foundation; we sometimes make exceptions for this. Our
431 | decision will be guided by the two goals of preserving the free status
432 | of all derivatives of our free software and of promoting the sharing
433 | and reuse of software generally.
434 |
435 | NO WARRANTY
436 |
437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446 |
447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456 | DAMAGES.
457 |
458 | END OF TERMS AND CONDITIONS
459 |
460 | How to Apply These Terms to Your New Libraries
461 |
462 | If you develop a new library, and you want it to be of the greatest
463 | possible use to the public, we recommend making it free software that
464 | everyone can redistribute and change. You can do so by permitting
465 | redistribution under these terms (or, alternatively, under the terms of the
466 | ordinary General Public License).
467 |
468 | To apply these terms, attach the following notices to the library. It is
469 | safest to attach them to the start of each source file to most effectively
470 | convey the exclusion of warranty; and each file should have at least the
471 | "copyright" line and a pointer to where the full notice is found.
472 |
473 |
474 | Copyright (C)
475 |
476 | This library is free software; you can redistribute it and/or
477 | modify it under the terms of the GNU Lesser General Public
478 | License as published by the Free Software Foundation; either
479 | version 2.1 of the License, or (at your option) any later version.
480 |
481 | This library is distributed in the hope that it will be useful,
482 | but WITHOUT ANY WARRANTY; without even the implied warranty of
483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484 | Lesser General Public License for more details.
485 |
486 | You should have received a copy of the GNU Lesser General Public
487 | License along with this library; if not, write to the Free Software
488 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
489 |
490 | Also add information on how to contact you by electronic and paper mail.
491 |
492 | You should also get your employer (if you work as a programmer) or your
493 | school, if any, to sign a "copyright disclaimer" for the library, if
494 | necessary. Here is a sample; alter the names:
495 |
496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the
497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498 |
499 | , 1 April 1990
500 | Ty Coon, President of Vice
501 |
502 | That's all there is to it!
503 |
504 |
505 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/libusb/COPYING:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 2.1, February 1999
3 |
4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | [This is the first released version of the Lesser GPL. It also counts
10 | as the successor of the GNU Library Public License, version 2, hence
11 | the version number 2.1.]
12 |
13 | Preamble
14 |
15 | The licenses for most software are designed to take away your
16 | freedom to share and change it. By contrast, the GNU General Public
17 | Licenses are intended to guarantee your freedom to share and change
18 | free software--to make sure the software is free for all its users.
19 |
20 | This license, the Lesser General Public License, applies to some
21 | specially designated software packages--typically libraries--of the
22 | Free Software Foundation and other authors who decide to use it. You
23 | can use it too, but we suggest you first think carefully about whether
24 | this license or the ordinary General Public License is the better
25 | strategy to use in any particular case, based on the explanations below.
26 |
27 | When we speak of free software, we are referring to freedom of use,
28 | not price. Our General Public Licenses are designed to make sure that
29 | you have the freedom to distribute copies of free software (and charge
30 | for this service if you wish); that you receive source code or can get
31 | it if you want it; that you can change the software and use pieces of
32 | it in new free programs; and that you are informed that you can do
33 | these things.
34 |
35 | To protect your rights, we need to make restrictions that forbid
36 | distributors to deny you these rights or to ask you to surrender these
37 | rights. These restrictions translate to certain responsibilities for
38 | you if you distribute copies of the library or if you modify it.
39 |
40 | For example, if you distribute copies of the library, whether gratis
41 | or for a fee, you must give the recipients all the rights that we gave
42 | you. You must make sure that they, too, receive or can get the source
43 | code. If you link other code with the library, you must provide
44 | complete object files to the recipients, so that they can relink them
45 | with the library after making changes to the library and recompiling
46 | it. And you must show them these terms so they know their rights.
47 |
48 | We protect your rights with a two-step method: (1) we copyright the
49 | library, and (2) we offer you this license, which gives you legal
50 | permission to copy, distribute and/or modify the library.
51 |
52 | To protect each distributor, we want to make it very clear that
53 | there is no warranty for the free library. Also, if the library is
54 | modified by someone else and passed on, the recipients should know
55 | that what they have is not the original version, so that the original
56 | author's reputation will not be affected by problems that might be
57 | introduced by others.
58 |
59 | Finally, software patents pose a constant threat to the existence of
60 | any free program. We wish to make sure that a company cannot
61 | effectively restrict the users of a free program by obtaining a
62 | restrictive license from a patent holder. Therefore, we insist that
63 | any patent license obtained for a version of the library must be
64 | consistent with the full freedom of use specified in this license.
65 |
66 | Most GNU software, including some libraries, is covered by the
67 | ordinary GNU General Public License. This license, the GNU Lesser
68 | General Public License, applies to certain designated libraries, and
69 | is quite different from the ordinary General Public License. We use
70 | this license for certain libraries in order to permit linking those
71 | libraries into non-free programs.
72 |
73 | When a program is linked with a library, whether statically or using
74 | a shared library, the combination of the two is legally speaking a
75 | combined work, a derivative of the original library. The ordinary
76 | General Public License therefore permits such linking only if the
77 | entire combination fits its criteria of freedom. The Lesser General
78 | Public License permits more lax criteria for linking other code with
79 | the library.
80 |
81 | We call this license the "Lesser" General Public License because it
82 | does Less to protect the user's freedom than the ordinary General
83 | Public License. It also provides other free software developers Less
84 | of an advantage over competing non-free programs. These disadvantages
85 | are the reason we use the ordinary General Public License for many
86 | libraries. However, the Lesser license provides advantages in certain
87 | special circumstances.
88 |
89 | For example, on rare occasions, there may be a special need to
90 | encourage the widest possible use of a certain library, so that it becomes
91 | a de-facto standard. To achieve this, non-free programs must be
92 | allowed to use the library. A more frequent case is that a free
93 | library does the same job as widely used non-free libraries. In this
94 | case, there is little to gain by limiting the free library to free
95 | software only, so we use the Lesser General Public License.
96 |
97 | In other cases, permission to use a particular library in non-free
98 | programs enables a greater number of people to use a large body of
99 | free software. For example, permission to use the GNU C Library in
100 | non-free programs enables many more people to use the whole GNU
101 | operating system, as well as its variant, the GNU/Linux operating
102 | system.
103 |
104 | Although the Lesser General Public License is Less protective of the
105 | users' freedom, it does ensure that the user of a program that is
106 | linked with the Library has the freedom and the wherewithal to run
107 | that program using a modified version of the Library.
108 |
109 | The precise terms and conditions for copying, distribution and
110 | modification follow. Pay close attention to the difference between a
111 | "work based on the library" and a "work that uses the library". The
112 | former contains code derived from the library, whereas the latter must
113 | be combined with the library in order to run.
114 |
115 | GNU LESSER GENERAL PUBLIC LICENSE
116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117 |
118 | 0. This License Agreement applies to any software library or other
119 | program which contains a notice placed by the copyright holder or
120 | other authorized party saying it may be distributed under the terms of
121 | this Lesser General Public License (also called "this License").
122 | Each licensee is addressed as "you".
123 |
124 | A "library" means a collection of software functions and/or data
125 | prepared so as to be conveniently linked with application programs
126 | (which use some of those functions and data) to form executables.
127 |
128 | The "Library", below, refers to any such software library or work
129 | which has been distributed under these terms. A "work based on the
130 | Library" means either the Library or any derivative work under
131 | copyright law: that is to say, a work containing the Library or a
132 | portion of it, either verbatim or with modifications and/or translated
133 | straightforwardly into another language. (Hereinafter, translation is
134 | included without limitation in the term "modification".)
135 |
136 | "Source code" for a work means the preferred form of the work for
137 | making modifications to it. For a library, complete source code means
138 | all the source code for all modules it contains, plus any associated
139 | interface definition files, plus the scripts used to control compilation
140 | and installation of the library.
141 |
142 | Activities other than copying, distribution and modification are not
143 | covered by this License; they are outside its scope. The act of
144 | running a program using the Library is not restricted, and output from
145 | such a program is covered only if its contents constitute a work based
146 | on the Library (independent of the use of the Library in a tool for
147 | writing it). Whether that is true depends on what the Library does
148 | and what the program that uses the Library does.
149 |
150 | 1. You may copy and distribute verbatim copies of the Library's
151 | complete source code as you receive it, in any medium, provided that
152 | you conspicuously and appropriately publish on each copy an
153 | appropriate copyright notice and disclaimer of warranty; keep intact
154 | all the notices that refer to this License and to the absence of any
155 | warranty; and distribute a copy of this License along with the
156 | Library.
157 |
158 | You may charge a fee for the physical act of transferring a copy,
159 | and you may at your option offer warranty protection in exchange for a
160 | fee.
161 |
162 | 2. You may modify your copy or copies of the Library or any portion
163 | of it, thus forming a work based on the Library, and copy and
164 | distribute such modifications or work under the terms of Section 1
165 | above, provided that you also meet all of these conditions:
166 |
167 | a) The modified work must itself be a software library.
168 |
169 | b) You must cause the files modified to carry prominent notices
170 | stating that you changed the files and the date of any change.
171 |
172 | c) You must cause the whole of the work to be licensed at no
173 | charge to all third parties under the terms of this License.
174 |
175 | d) If a facility in the modified Library refers to a function or a
176 | table of data to be supplied by an application program that uses
177 | the facility, other than as an argument passed when the facility
178 | is invoked, then you must make a good faith effort to ensure that,
179 | in the event an application does not supply such function or
180 | table, the facility still operates, and performs whatever part of
181 | its purpose remains meaningful.
182 |
183 | (For example, a function in a library to compute square roots has
184 | a purpose that is entirely well-defined independent of the
185 | application. Therefore, Subsection 2d requires that any
186 | application-supplied function or table used by this function must
187 | be optional: if the application does not supply it, the square
188 | root function must still compute square roots.)
189 |
190 | These requirements apply to the modified work as a whole. If
191 | identifiable sections of that work are not derived from the Library,
192 | and can be reasonably considered independent and separate works in
193 | themselves, then this License, and its terms, do not apply to those
194 | sections when you distribute them as separate works. But when you
195 | distribute the same sections as part of a whole which is a work based
196 | on the Library, the distribution of the whole must be on the terms of
197 | this License, whose permissions for other licensees extend to the
198 | entire whole, and thus to each and every part regardless of who wrote
199 | it.
200 |
201 | Thus, it is not the intent of this section to claim rights or contest
202 | your rights to work written entirely by you; rather, the intent is to
203 | exercise the right to control the distribution of derivative or
204 | collective works based on the Library.
205 |
206 | In addition, mere aggregation of another work not based on the Library
207 | with the Library (or with a work based on the Library) on a volume of
208 | a storage or distribution medium does not bring the other work under
209 | the scope of this License.
210 |
211 | 3. You may opt to apply the terms of the ordinary GNU General Public
212 | License instead of this License to a given copy of the Library. To do
213 | this, you must alter all the notices that refer to this License, so
214 | that they refer to the ordinary GNU General Public License, version 2,
215 | instead of to this License. (If a newer version than version 2 of the
216 | ordinary GNU General Public License has appeared, then you can specify
217 | that version instead if you wish.) Do not make any other change in
218 | these notices.
219 |
220 | Once this change is made in a given copy, it is irreversible for
221 | that copy, so the ordinary GNU General Public License applies to all
222 | subsequent copies and derivative works made from that copy.
223 |
224 | This option is useful when you wish to copy part of the code of
225 | the Library into a program that is not a library.
226 |
227 | 4. You may copy and distribute the Library (or a portion or
228 | derivative of it, under Section 2) in object code or executable form
229 | under the terms of Sections 1 and 2 above provided that you accompany
230 | it with the complete corresponding machine-readable source code, which
231 | must be distributed under the terms of Sections 1 and 2 above on a
232 | medium customarily used for software interchange.
233 |
234 | If distribution of object code is made by offering access to copy
235 | from a designated place, then offering equivalent access to copy the
236 | source code from the same place satisfies the requirement to
237 | distribute the source code, even though third parties are not
238 | compelled to copy the source along with the object code.
239 |
240 | 5. A program that contains no derivative of any portion of the
241 | Library, but is designed to work with the Library by being compiled or
242 | linked with it, is called a "work that uses the Library". Such a
243 | work, in isolation, is not a derivative work of the Library, and
244 | therefore falls outside the scope of this License.
245 |
246 | However, linking a "work that uses the Library" with the Library
247 | creates an executable that is a derivative of the Library (because it
248 | contains portions of the Library), rather than a "work that uses the
249 | library". The executable is therefore covered by this License.
250 | Section 6 states terms for distribution of such executables.
251 |
252 | When a "work that uses the Library" uses material from a header file
253 | that is part of the Library, the object code for the work may be a
254 | derivative work of the Library even though the source code is not.
255 | Whether this is true is especially significant if the work can be
256 | linked without the Library, or if the work is itself a library. The
257 | threshold for this to be true is not precisely defined by law.
258 |
259 | If such an object file uses only numerical parameters, data
260 | structure layouts and accessors, and small macros and small inline
261 | functions (ten lines or less in length), then the use of the object
262 | file is unrestricted, regardless of whether it is legally a derivative
263 | work. (Executables containing this object code plus portions of the
264 | Library will still fall under Section 6.)
265 |
266 | Otherwise, if the work is a derivative of the Library, you may
267 | distribute the object code for the work under the terms of Section 6.
268 | Any executables containing that work also fall under Section 6,
269 | whether or not they are linked directly with the Library itself.
270 |
271 | 6. As an exception to the Sections above, you may also combine or
272 | link a "work that uses the Library" with the Library to produce a
273 | work containing portions of the Library, and distribute that work
274 | under terms of your choice, provided that the terms permit
275 | modification of the work for the customer's own use and reverse
276 | engineering for debugging such modifications.
277 |
278 | You must give prominent notice with each copy of the work that the
279 | Library is used in it and that the Library and its use are covered by
280 | this License. You must supply a copy of this License. If the work
281 | during execution displays copyright notices, you must include the
282 | copyright notice for the Library among them, as well as a reference
283 | directing the user to the copy of this License. Also, you must do one
284 | of these things:
285 |
286 | a) Accompany the work with the complete corresponding
287 | machine-readable source code for the Library including whatever
288 | changes were used in the work (which must be distributed under
289 | Sections 1 and 2 above); and, if the work is an executable linked
290 | with the Library, with the complete machine-readable "work that
291 | uses the Library", as object code and/or source code, so that the
292 | user can modify the Library and then relink to produce a modified
293 | executable containing the modified Library. (It is understood
294 | that the user who changes the contents of definitions files in the
295 | Library will not necessarily be able to recompile the application
296 | to use the modified definitions.)
297 |
298 | b) Use a suitable shared library mechanism for linking with the
299 | Library. A suitable mechanism is one that (1) uses at run time a
300 | copy of the library already present on the user's computer system,
301 | rather than copying library functions into the executable, and (2)
302 | will operate properly with a modified version of the library, if
303 | the user installs one, as long as the modified version is
304 | interface-compatible with the version that the work was made with.
305 |
306 | c) Accompany the work with a written offer, valid for at
307 | least three years, to give the same user the materials
308 | specified in Subsection 6a, above, for a charge no more
309 | than the cost of performing this distribution.
310 |
311 | d) If distribution of the work is made by offering access to copy
312 | from a designated place, offer equivalent access to copy the above
313 | specified materials from the same place.
314 |
315 | e) Verify that the user has already received a copy of these
316 | materials or that you have already sent this user a copy.
317 |
318 | For an executable, the required form of the "work that uses the
319 | Library" must include any data and utility programs needed for
320 | reproducing the executable from it. However, as a special exception,
321 | the materials to be distributed need not include anything that is
322 | normally distributed (in either source or binary form) with the major
323 | components (compiler, kernel, and so on) of the operating system on
324 | which the executable runs, unless that component itself accompanies
325 | the executable.
326 |
327 | It may happen that this requirement contradicts the license
328 | restrictions of other proprietary libraries that do not normally
329 | accompany the operating system. Such a contradiction means you cannot
330 | use both them and the Library together in an executable that you
331 | distribute.
332 |
333 | 7. You may place library facilities that are a work based on the
334 | Library side-by-side in a single library together with other library
335 | facilities not covered by this License, and distribute such a combined
336 | library, provided that the separate distribution of the work based on
337 | the Library and of the other library facilities is otherwise
338 | permitted, and provided that you do these two things:
339 |
340 | a) Accompany the combined library with a copy of the same work
341 | based on the Library, uncombined with any other library
342 | facilities. This must be distributed under the terms of the
343 | Sections above.
344 |
345 | b) Give prominent notice with the combined library of the fact
346 | that part of it is a work based on the Library, and explaining
347 | where to find the accompanying uncombined form of the same work.
348 |
349 | 8. You may not copy, modify, sublicense, link with, or distribute
350 | the Library except as expressly provided under this License. Any
351 | attempt otherwise to copy, modify, sublicense, link with, or
352 | distribute the Library is void, and will automatically terminate your
353 | rights under this License. However, parties who have received copies,
354 | or rights, from you under this License will not have their licenses
355 | terminated so long as such parties remain in full compliance.
356 |
357 | 9. You are not required to accept this License, since you have not
358 | signed it. However, nothing else grants you permission to modify or
359 | distribute the Library or its derivative works. These actions are
360 | prohibited by law if you do not accept this License. Therefore, by
361 | modifying or distributing the Library (or any work based on the
362 | Library), you indicate your acceptance of this License to do so, and
363 | all its terms and conditions for copying, distributing or modifying
364 | the Library or works based on it.
365 |
366 | 10. Each time you redistribute the Library (or any work based on the
367 | Library), the recipient automatically receives a license from the
368 | original licensor to copy, distribute, link with or modify the Library
369 | subject to these terms and conditions. You may not impose any further
370 | restrictions on the recipients' exercise of the rights granted herein.
371 | You are not responsible for enforcing compliance by third parties with
372 | this License.
373 |
374 | 11. If, as a consequence of a court judgment or allegation of patent
375 | infringement or for any other reason (not limited to patent issues),
376 | conditions are imposed on you (whether by court order, agreement or
377 | otherwise) that contradict the conditions of this License, they do not
378 | excuse you from the conditions of this License. If you cannot
379 | distribute so as to satisfy simultaneously your obligations under this
380 | License and any other pertinent obligations, then as a consequence you
381 | may not distribute the Library at all. For example, if a patent
382 | license would not permit royalty-free redistribution of the Library by
383 | all those who receive copies directly or indirectly through you, then
384 | the only way you could satisfy both it and this License would be to
385 | refrain entirely from distribution of the Library.
386 |
387 | If any portion of this section is held invalid or unenforceable under any
388 | particular circumstance, the balance of the section is intended to apply,
389 | and the section as a whole is intended to apply in other circumstances.
390 |
391 | It is not the purpose of this section to induce you to infringe any
392 | patents or other property right claims or to contest validity of any
393 | such claims; this section has the sole purpose of protecting the
394 | integrity of the free software distribution system which is
395 | implemented by public license practices. Many people have made
396 | generous contributions to the wide range of software distributed
397 | through that system in reliance on consistent application of that
398 | system; it is up to the author/donor to decide if he or she is willing
399 | to distribute software through any other system and a licensee cannot
400 | impose that choice.
401 |
402 | This section is intended to make thoroughly clear what is believed to
403 | be a consequence of the rest of this License.
404 |
405 | 12. If the distribution and/or use of the Library is restricted in
406 | certain countries either by patents or by copyrighted interfaces, the
407 | original copyright holder who places the Library under this License may add
408 | an explicit geographical distribution limitation excluding those countries,
409 | so that distribution is permitted only in or among countries not thus
410 | excluded. In such case, this License incorporates the limitation as if
411 | written in the body of this License.
412 |
413 | 13. The Free Software Foundation may publish revised and/or new
414 | versions of the Lesser General Public License from time to time.
415 | Such new versions will be similar in spirit to the present version,
416 | but may differ in detail to address new problems or concerns.
417 |
418 | Each version is given a distinguishing version number. If the Library
419 | specifies a version number of this License which applies to it and
420 | "any later version", you have the option of following the terms and
421 | conditions either of that version or of any later version published by
422 | the Free Software Foundation. If the Library does not specify a
423 | license version number, you may choose any version ever published by
424 | the Free Software Foundation.
425 |
426 | 14. If you wish to incorporate parts of the Library into other free
427 | programs whose distribution conditions are incompatible with these,
428 | write to the author to ask for permission. For software which is
429 | copyrighted by the Free Software Foundation, write to the Free
430 | Software Foundation; we sometimes make exceptions for this. Our
431 | decision will be guided by the two goals of preserving the free status
432 | of all derivatives of our free software and of promoting the sharing
433 | and reuse of software generally.
434 |
435 | NO WARRANTY
436 |
437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446 |
447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456 | DAMAGES.
457 |
458 | END OF TERMS AND CONDITIONS
459 |
460 | How to Apply These Terms to Your New Libraries
461 |
462 | If you develop a new library, and you want it to be of the greatest
463 | possible use to the public, we recommend making it free software that
464 | everyone can redistribute and change. You can do so by permitting
465 | redistribution under these terms (or, alternatively, under the terms of the
466 | ordinary General Public License).
467 |
468 | To apply these terms, attach the following notices to the library. It is
469 | safest to attach them to the start of each source file to most effectively
470 | convey the exclusion of warranty; and each file should have at least the
471 | "copyright" line and a pointer to where the full notice is found.
472 |
473 |
474 | Copyright (C)
475 |
476 | This library is free software; you can redistribute it and/or
477 | modify it under the terms of the GNU Lesser General Public
478 | License as published by the Free Software Foundation; either
479 | version 2.1 of the License, or (at your option) any later version.
480 |
481 | This library is distributed in the hope that it will be useful,
482 | but WITHOUT ANY WARRANTY; without even the implied warranty of
483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484 | Lesser General Public License for more details.
485 |
486 | You should have received a copy of the GNU Lesser General Public
487 | License along with this library; if not, write to the Free Software
488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
489 |
490 | Also add information on how to contact you by electronic and paper mail.
491 |
492 | You should also get your employer (if you work as a programmer) or your
493 | school, if any, to sign a "copyright disclaimer" for the library, if
494 | necessary. Here is a sample; alter the names:
495 |
496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the
497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498 |
499 | , 1 April 1990
500 | Ty Coon, President of Vice
501 |
502 | That's all there is to it!
503 |
--------------------------------------------------------------------------------
/LibBladeRF/licenses/bladeRF/LICENSE.LGPLv2.1:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 2.1, February 1999
3 |
4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | [This is the first released version of the Lesser GPL. It also counts
10 | as the successor of the GNU Library Public License, version 2, hence
11 | the version number 2.1.]
12 |
13 | Preamble
14 |
15 | The licenses for most software are designed to take away your
16 | freedom to share and change it. By contrast, the GNU General Public
17 | Licenses are intended to guarantee your freedom to share and change
18 | free software--to make sure the software is free for all its users.
19 |
20 | This license, the Lesser General Public License, applies to some
21 | specially designated software packages--typically libraries--of the
22 | Free Software Foundation and other authors who decide to use it. You
23 | can use it too, but we suggest you first think carefully about whether
24 | this license or the ordinary General Public License is the better
25 | strategy to use in any particular case, based on the explanations below.
26 |
27 | When we speak of free software, we are referring to freedom of use,
28 | not price. Our General Public Licenses are designed to make sure that
29 | you have the freedom to distribute copies of free software (and charge
30 | for this service if you wish); that you receive source code or can get
31 | it if you want it; that you can change the software and use pieces of
32 | it in new free programs; and that you are informed that you can do
33 | these things.
34 |
35 | To protect your rights, we need to make restrictions that forbid
36 | distributors to deny you these rights or to ask you to surrender these
37 | rights. These restrictions translate to certain responsibilities for
38 | you if you distribute copies of the library or if you modify it.
39 |
40 | For example, if you distribute copies of the library, whether gratis
41 | or for a fee, you must give the recipients all the rights that we gave
42 | you. You must make sure that they, too, receive or can get the source
43 | code. If you link other code with the library, you must provide
44 | complete object files to the recipients, so that they can relink them
45 | with the library after making changes to the library and recompiling
46 | it. And you must show them these terms so they know their rights.
47 |
48 | We protect your rights with a two-step method: (1) we copyright the
49 | library, and (2) we offer you this license, which gives you legal
50 | permission to copy, distribute and/or modify the library.
51 |
52 | To protect each distributor, we want to make it very clear that
53 | there is no warranty for the free library. Also, if the library is
54 | modified by someone else and passed on, the recipients should know
55 | that what they have is not the original version, so that the original
56 | author's reputation will not be affected by problems that might be
57 | introduced by others.
58 |
59 | Finally, software patents pose a constant threat to the existence of
60 | any free program. We wish to make sure that a company cannot
61 | effectively restrict the users of a free program by obtaining a
62 | restrictive license from a patent holder. Therefore, we insist that
63 | any patent license obtained for a version of the library must be
64 | consistent with the full freedom of use specified in this license.
65 |
66 | Most GNU software, including some libraries, is covered by the
67 | ordinary GNU General Public License. This license, the GNU Lesser
68 | General Public License, applies to certain designated libraries, and
69 | is quite different from the ordinary General Public License. We use
70 | this license for certain libraries in order to permit linking those
71 | libraries into non-free programs.
72 |
73 | When a program is linked with a library, whether statically or using
74 | a shared library, the combination of the two is legally speaking a
75 | combined work, a derivative of the original library. The ordinary
76 | General Public License therefore permits such linking only if the
77 | entire combination fits its criteria of freedom. The Lesser General
78 | Public License permits more lax criteria for linking other code with
79 | the library.
80 |
81 | We call this license the "Lesser" General Public License because it
82 | does Less to protect the user's freedom than the ordinary General
83 | Public License. It also provides other free software developers Less
84 | of an advantage over competing non-free programs. These disadvantages
85 | are the reason we use the ordinary General Public License for many
86 | libraries. However, the Lesser license provides advantages in certain
87 | special circumstances.
88 |
89 | For example, on rare occasions, there may be a special need to
90 | encourage the widest possible use of a certain library, so that it becomes
91 | a de-facto standard. To achieve this, non-free programs must be
92 | allowed to use the library. A more frequent case is that a free
93 | library does the same job as widely used non-free libraries. In this
94 | case, there is little to gain by limiting the free library to free
95 | software only, so we use the Lesser General Public License.
96 |
97 | In other cases, permission to use a particular library in non-free
98 | programs enables a greater number of people to use a large body of
99 | free software. For example, permission to use the GNU C Library in
100 | non-free programs enables many more people to use the whole GNU
101 | operating system, as well as its variant, the GNU/Linux operating
102 | system.
103 |
104 | Although the Lesser General Public License is Less protective of the
105 | users' freedom, it does ensure that the user of a program that is
106 | linked with the Library has the freedom and the wherewithal to run
107 | that program using a modified version of the Library.
108 |
109 | The precise terms and conditions for copying, distribution and
110 | modification follow. Pay close attention to the difference between a
111 | "work based on the library" and a "work that uses the library". The
112 | former contains code derived from the library, whereas the latter must
113 | be combined with the library in order to run.
114 |
115 | GNU LESSER GENERAL PUBLIC LICENSE
116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117 |
118 | 0. This License Agreement applies to any software library or other
119 | program which contains a notice placed by the copyright holder or
120 | other authorized party saying it may be distributed under the terms of
121 | this Lesser General Public License (also called "this License").
122 | Each licensee is addressed as "you".
123 |
124 | A "library" means a collection of software functions and/or data
125 | prepared so as to be conveniently linked with application programs
126 | (which use some of those functions and data) to form executables.
127 |
128 | The "Library", below, refers to any such software library or work
129 | which has been distributed under these terms. A "work based on the
130 | Library" means either the Library or any derivative work under
131 | copyright law: that is to say, a work containing the Library or a
132 | portion of it, either verbatim or with modifications and/or translated
133 | straightforwardly into another language. (Hereinafter, translation is
134 | included without limitation in the term "modification".)
135 |
136 | "Source code" for a work means the preferred form of the work for
137 | making modifications to it. For a library, complete source code means
138 | all the source code for all modules it contains, plus any associated
139 | interface definition files, plus the scripts used to control compilation
140 | and installation of the library.
141 |
142 | Activities other than copying, distribution and modification are not
143 | covered by this License; they are outside its scope. The act of
144 | running a program using the Library is not restricted, and output from
145 | such a program is covered only if its contents constitute a work based
146 | on the Library (independent of the use of the Library in a tool for
147 | writing it). Whether that is true depends on what the Library does
148 | and what the program that uses the Library does.
149 |
150 | 1. You may copy and distribute verbatim copies of the Library's
151 | complete source code as you receive it, in any medium, provided that
152 | you conspicuously and appropriately publish on each copy an
153 | appropriate copyright notice and disclaimer of warranty; keep intact
154 | all the notices that refer to this License and to the absence of any
155 | warranty; and distribute a copy of this License along with the
156 | Library.
157 |
158 | You may charge a fee for the physical act of transferring a copy,
159 | and you may at your option offer warranty protection in exchange for a
160 | fee.
161 |
162 | 2. You may modify your copy or copies of the Library or any portion
163 | of it, thus forming a work based on the Library, and copy and
164 | distribute such modifications or work under the terms of Section 1
165 | above, provided that you also meet all of these conditions:
166 |
167 | a) The modified work must itself be a software library.
168 |
169 | b) You must cause the files modified to carry prominent notices
170 | stating that you changed the files and the date of any change.
171 |
172 | c) You must cause the whole of the work to be licensed at no
173 | charge to all third parties under the terms of this License.
174 |
175 | d) If a facility in the modified Library refers to a function or a
176 | table of data to be supplied by an application program that uses
177 | the facility, other than as an argument passed when the facility
178 | is invoked, then you must make a good faith effort to ensure that,
179 | in the event an application does not supply such function or
180 | table, the facility still operates, and performs whatever part of
181 | its purpose remains meaningful.
182 |
183 | (For example, a function in a library to compute square roots has
184 | a purpose that is entirely well-defined independent of the
185 | application. Therefore, Subsection 2d requires that any
186 | application-supplied function or table used by this function must
187 | be optional: if the application does not supply it, the square
188 | root function must still compute square roots.)
189 |
190 | These requirements apply to the modified work as a whole. If
191 | identifiable sections of that work are not derived from the Library,
192 | and can be reasonably considered independent and separate works in
193 | themselves, then this License, and its terms, do not apply to those
194 | sections when you distribute them as separate works. But when you
195 | distribute the same sections as part of a whole which is a work based
196 | on the Library, the distribution of the whole must be on the terms of
197 | this License, whose permissions for other licensees extend to the
198 | entire whole, and thus to each and every part regardless of who wrote
199 | it.
200 |
201 | Thus, it is not the intent of this section to claim rights or contest
202 | your rights to work written entirely by you; rather, the intent is to
203 | exercise the right to control the distribution of derivative or
204 | collective works based on the Library.
205 |
206 | In addition, mere aggregation of another work not based on the Library
207 | with the Library (or with a work based on the Library) on a volume of
208 | a storage or distribution medium does not bring the other work under
209 | the scope of this License.
210 |
211 | 3. You may opt to apply the terms of the ordinary GNU General Public
212 | License instead of this License to a given copy of the Library. To do
213 | this, you must alter all the notices that refer to this License, so
214 | that they refer to the ordinary GNU General Public License, version 2,
215 | instead of to this License. (If a newer version than version 2 of the
216 | ordinary GNU General Public License has appeared, then you can specify
217 | that version instead if you wish.) Do not make any other change in
218 | these notices.
219 |
220 | Once this change is made in a given copy, it is irreversible for
221 | that copy, so the ordinary GNU General Public License applies to all
222 | subsequent copies and derivative works made from that copy.
223 |
224 | This option is useful when you wish to copy part of the code of
225 | the Library into a program that is not a library.
226 |
227 | 4. You may copy and distribute the Library (or a portion or
228 | derivative of it, under Section 2) in object code or executable form
229 | under the terms of Sections 1 and 2 above provided that you accompany
230 | it with the complete corresponding machine-readable source code, which
231 | must be distributed under the terms of Sections 1 and 2 above on a
232 | medium customarily used for software interchange.
233 |
234 | If distribution of object code is made by offering access to copy
235 | from a designated place, then offering equivalent access to copy the
236 | source code from the same place satisfies the requirement to
237 | distribute the source code, even though third parties are not
238 | compelled to copy the source along with the object code.
239 |
240 | 5. A program that contains no derivative of any portion of the
241 | Library, but is designed to work with the Library by being compiled or
242 | linked with it, is called a "work that uses the Library". Such a
243 | work, in isolation, is not a derivative work of the Library, and
244 | therefore falls outside the scope of this License.
245 |
246 | However, linking a "work that uses the Library" with the Library
247 | creates an executable that is a derivative of the Library (because it
248 | contains portions of the Library), rather than a "work that uses the
249 | library". The executable is therefore covered by this License.
250 | Section 6 states terms for distribution of such executables.
251 |
252 | When a "work that uses the Library" uses material from a header file
253 | that is part of the Library, the object code for the work may be a
254 | derivative work of the Library even though the source code is not.
255 | Whether this is true is especially significant if the work can be
256 | linked without the Library, or if the work is itself a library. The
257 | threshold for this to be true is not precisely defined by law.
258 |
259 | If such an object file uses only numerical parameters, data
260 | structure layouts and accessors, and small macros and small inline
261 | functions (ten lines or less in length), then the use of the object
262 | file is unrestricted, regardless of whether it is legally a derivative
263 | work. (Executables containing this object code plus portions of the
264 | Library will still fall under Section 6.)
265 |
266 | Otherwise, if the work is a derivative of the Library, you may
267 | distribute the object code for the work under the terms of Section 6.
268 | Any executables containing that work also fall under Section 6,
269 | whether or not they are linked directly with the Library itself.
270 |
271 | 6. As an exception to the Sections above, you may also combine or
272 | link a "work that uses the Library" with the Library to produce a
273 | work containing portions of the Library, and distribute that work
274 | under terms of your choice, provided that the terms permit
275 | modification of the work for the customer's own use and reverse
276 | engineering for debugging such modifications.
277 |
278 | You must give prominent notice with each copy of the work that the
279 | Library is used in it and that the Library and its use are covered by
280 | this License. You must supply a copy of this License. If the work
281 | during execution displays copyright notices, you must include the
282 | copyright notice for the Library among them, as well as a reference
283 | directing the user to the copy of this License. Also, you must do one
284 | of these things:
285 |
286 | a) Accompany the work with the complete corresponding
287 | machine-readable source code for the Library including whatever
288 | changes were used in the work (which must be distributed under
289 | Sections 1 and 2 above); and, if the work is an executable linked
290 | with the Library, with the complete machine-readable "work that
291 | uses the Library", as object code and/or source code, so that the
292 | user can modify the Library and then relink to produce a modified
293 | executable containing the modified Library. (It is understood
294 | that the user who changes the contents of definitions files in the
295 | Library will not necessarily be able to recompile the application
296 | to use the modified definitions.)
297 |
298 | b) Use a suitable shared library mechanism for linking with the
299 | Library. A suitable mechanism is one that (1) uses at run time a
300 | copy of the library already present on the user's computer system,
301 | rather than copying library functions into the executable, and (2)
302 | will operate properly with a modified version of the library, if
303 | the user installs one, as long as the modified version is
304 | interface-compatible with the version that the work was made with.
305 |
306 | c) Accompany the work with a written offer, valid for at
307 | least three years, to give the same user the materials
308 | specified in Subsection 6a, above, for a charge no more
309 | than the cost of performing this distribution.
310 |
311 | d) If distribution of the work is made by offering access to copy
312 | from a designated place, offer equivalent access to copy the above
313 | specified materials from the same place.
314 |
315 | e) Verify that the user has already received a copy of these
316 | materials or that you have already sent this user a copy.
317 |
318 | For an executable, the required form of the "work that uses the
319 | Library" must include any data and utility programs needed for
320 | reproducing the executable from it. However, as a special exception,
321 | the materials to be distributed need not include anything that is
322 | normally distributed (in either source or binary form) with the major
323 | components (compiler, kernel, and so on) of the operating system on
324 | which the executable runs, unless that component itself accompanies
325 | the executable.
326 |
327 | It may happen that this requirement contradicts the license
328 | restrictions of other proprietary libraries that do not normally
329 | accompany the operating system. Such a contradiction means you cannot
330 | use both them and the Library together in an executable that you
331 | distribute.
332 |
333 | 7. You may place library facilities that are a work based on the
334 | Library side-by-side in a single library together with other library
335 | facilities not covered by this License, and distribute such a combined
336 | library, provided that the separate distribution of the work based on
337 | the Library and of the other library facilities is otherwise
338 | permitted, and provided that you do these two things:
339 |
340 | a) Accompany the combined library with a copy of the same work
341 | based on the Library, uncombined with any other library
342 | facilities. This must be distributed under the terms of the
343 | Sections above.
344 |
345 | b) Give prominent notice with the combined library of the fact
346 | that part of it is a work based on the Library, and explaining
347 | where to find the accompanying uncombined form of the same work.
348 |
349 | 8. You may not copy, modify, sublicense, link with, or distribute
350 | the Library except as expressly provided under this License. Any
351 | attempt otherwise to copy, modify, sublicense, link with, or
352 | distribute the Library is void, and will automatically terminate your
353 | rights under this License. However, parties who have received copies,
354 | or rights, from you under this License will not have their licenses
355 | terminated so long as such parties remain in full compliance.
356 |
357 | 9. You are not required to accept this License, since you have not
358 | signed it. However, nothing else grants you permission to modify or
359 | distribute the Library or its derivative works. These actions are
360 | prohibited by law if you do not accept this License. Therefore, by
361 | modifying or distributing the Library (or any work based on the
362 | Library), you indicate your acceptance of this License to do so, and
363 | all its terms and conditions for copying, distributing or modifying
364 | the Library or works based on it.
365 |
366 | 10. Each time you redistribute the Library (or any work based on the
367 | Library), the recipient automatically receives a license from the
368 | original licensor to copy, distribute, link with or modify the Library
369 | subject to these terms and conditions. You may not impose any further
370 | restrictions on the recipients' exercise of the rights granted herein.
371 | You are not responsible for enforcing compliance by third parties with
372 | this License.
373 |
374 | 11. If, as a consequence of a court judgment or allegation of patent
375 | infringement or for any other reason (not limited to patent issues),
376 | conditions are imposed on you (whether by court order, agreement or
377 | otherwise) that contradict the conditions of this License, they do not
378 | excuse you from the conditions of this License. If you cannot
379 | distribute so as to satisfy simultaneously your obligations under this
380 | License and any other pertinent obligations, then as a consequence you
381 | may not distribute the Library at all. For example, if a patent
382 | license would not permit royalty-free redistribution of the Library by
383 | all those who receive copies directly or indirectly through you, then
384 | the only way you could satisfy both it and this License would be to
385 | refrain entirely from distribution of the Library.
386 |
387 | If any portion of this section is held invalid or unenforceable under any
388 | particular circumstance, the balance of the section is intended to apply,
389 | and the section as a whole is intended to apply in other circumstances.
390 |
391 | It is not the purpose of this section to induce you to infringe any
392 | patents or other property right claims or to contest validity of any
393 | such claims; this section has the sole purpose of protecting the
394 | integrity of the free software distribution system which is
395 | implemented by public license practices. Many people have made
396 | generous contributions to the wide range of software distributed
397 | through that system in reliance on consistent application of that
398 | system; it is up to the author/donor to decide if he or she is willing
399 | to distribute software through any other system and a licensee cannot
400 | impose that choice.
401 |
402 | This section is intended to make thoroughly clear what is believed to
403 | be a consequence of the rest of this License.
404 |
405 | 12. If the distribution and/or use of the Library is restricted in
406 | certain countries either by patents or by copyrighted interfaces, the
407 | original copyright holder who places the Library under this License may add
408 | an explicit geographical distribution limitation excluding those countries,
409 | so that distribution is permitted only in or among countries not thus
410 | excluded. In such case, this License incorporates the limitation as if
411 | written in the body of this License.
412 |
413 | 13. The Free Software Foundation may publish revised and/or new
414 | versions of the Lesser General Public License from time to time.
415 | Such new versions will be similar in spirit to the present version,
416 | but may differ in detail to address new problems or concerns.
417 |
418 | Each version is given a distinguishing version number. If the Library
419 | specifies a version number of this License which applies to it and
420 | "any later version", you have the option of following the terms and
421 | conditions either of that version or of any later version published by
422 | the Free Software Foundation. If the Library does not specify a
423 | license version number, you may choose any version ever published by
424 | the Free Software Foundation.
425 |
426 | 14. If you wish to incorporate parts of the Library into other free
427 | programs whose distribution conditions are incompatible with these,
428 | write to the author to ask for permission. For software which is
429 | copyrighted by the Free Software Foundation, write to the Free
430 | Software Foundation; we sometimes make exceptions for this. Our
431 | decision will be guided by the two goals of preserving the free status
432 | of all derivatives of our free software and of promoting the sharing
433 | and reuse of software generally.
434 |
435 | NO WARRANTY
436 |
437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446 |
447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456 | DAMAGES.
457 |
458 | END OF TERMS AND CONDITIONS
459 |
460 | How to Apply These Terms to Your New Libraries
461 |
462 | If you develop a new library, and you want it to be of the greatest
463 | possible use to the public, we recommend making it free software that
464 | everyone can redistribute and change. You can do so by permitting
465 | redistribution under these terms (or, alternatively, under the terms of the
466 | ordinary General Public License).
467 |
468 | To apply these terms, attach the following notices to the library. It is
469 | safest to attach them to the start of each source file to most effectively
470 | convey the exclusion of warranty; and each file should have at least the
471 | "copyright" line and a pointer to where the full notice is found.
472 |
473 |
474 | Copyright (C)
475 |
476 | This library is free software; you can redistribute it and/or
477 | modify it under the terms of the GNU Lesser General Public
478 | License as published by the Free Software Foundation; either
479 | version 2.1 of the License, or (at your option) any later version.
480 |
481 | This library is distributed in the hope that it will be useful,
482 | but WITHOUT ANY WARRANTY; without even the implied warranty of
483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484 | Lesser General Public License for more details.
485 |
486 | You should have received a copy of the GNU Lesser General Public
487 | License along with this library; if not, write to the Free Software
488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
489 |
490 | Also add information on how to contact you by electronic and paper mail.
491 |
492 | You should also get your employer (if you work as a programmer) or your
493 | school, if any, to sign a "copyright disclaimer" for the library, if
494 | necessary. Here is a sample; alter the names:
495 |
496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the
497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498 |
499 | , 1 April 1990
500 | Ty Coon, President of Vice
501 |
502 | That's all there is to it!
503 |
--------------------------------------------------------------------------------
/BladeRF/BladeRFDevice.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using SDRSharp.Radio;
3 | using System.Runtime.InteropServices;
4 | using System.Threading;
5 |
6 | namespace SDRSharp.BladeRF
7 | {
8 | public sealed class BladeRFDevice : IDisposable
9 | {
10 | private const uint DefaultFrequency = 405500000U;
11 | private const int DefaultSamplerate = 4000000;
12 | private const uint MinFrequency = 237500000;
13 | private const uint MaxFrequency = 3800000000;
14 | private const int MinBandwidth = 1500000;
15 | private const int MaxBandwidth = 28000000;
16 | private const uint SampleTimeoutMs = 1000;
17 | private const uint NumBuffers = 32;
18 |
19 | private static object syncLock = new object();
20 | private string DeviceName = "BladeRF";
21 | private string _serial;
22 | private IntPtr _dev;
23 | private long _centerFrequency = DefaultFrequency;
24 | private double _sampleRate = DefaultSamplerate;
25 | private int _bandwidth;
26 | private bool _isFpgaLoaded = false;
27 | private bool _RXConfigured = false;
28 | private string _fpga_path = Utils.GetStringSetting("BladeRFFPGA", "");
29 | private bladerf_lna_gain _lnaGain = (bladerf_lna_gain)Utils.GetIntSetting("BladeRFLNAGain", (int) bladerf_lna_gain.BLADERF_LNA_GAIN_MID);
30 | private int _vga1Gain = Utils.GetIntSetting("BladeRFRXVGA1Gain", 20);
31 | private int _vga2Gain = Utils.GetIntSetting("BladeRFRXVGA2Gain", 20);
32 | private bladerf_sampling _sampling = (bladerf_sampling)Utils.GetIntSetting("BladeRFSamplingMode", (int)bladerf_sampling.BLADERF_SAMPLING_INTERNAL);
33 | private GCHandle _gcHandle;
34 | private UnsafeBuffer _iqBuffer;
35 | private unsafe Complex* _iqPtr;
36 | private bool _isStreaming;
37 | private string _devSpec;
38 | private readonly SamplesAvailableEventArgs _eventArgs = new SamplesAvailableEventArgs();
39 | private static uint _readLength = 16384;
40 | private Thread _sampleThread = null;
41 | private static bladerf_version _version = NativeMethods.bladerf_version();
42 | private static bool _xb200_enabled = Utils.GetBooleanSetting("BladeRFXB200Enabled");
43 | private static bladerf_xb200_filter _xb200_filter = (bladerf_xb200_filter) (Utils.GetIntSetting("BladeRFXB200Filter", 0) - 1);
44 |
45 | private static readonly unsafe float* _lutPtr;
46 | private static readonly UnsafeBuffer _lutBuffer = UnsafeBuffer.Create(4096, sizeof(float));
47 | private UnsafeBuffer _samplesBuffer;
48 | private unsafe Int16* _samplesPtr;
49 |
50 | public bool XB200Enabled
51 | {
52 | get { return _xb200_enabled; }
53 | set
54 | {
55 | _xb200_enabled = value;
56 | if (value == true && _dev != IntPtr.Zero)
57 | {
58 | NativeMethods.bladerf_xb200_attach(_dev);
59 | }
60 | }
61 | }
62 |
63 | public int XB200Filter
64 | {
65 | get { return (int) (_xb200_filter + 1); }
66 | set
67 | {
68 | switch (value - 1)
69 | {
70 | case (int)bladerf_xb200_filter.BLADERF_XB200_AUTO:
71 | _xb200_filter = bladerf_xb200_filter.BLADERF_XB200_AUTO;
72 | break;
73 | case (int)bladerf_xb200_filter.BLADERF_XB200_50M:
74 | _xb200_filter = bladerf_xb200_filter.BLADERF_XB200_50M;
75 | break;
76 | case (int)bladerf_xb200_filter.BLADERF_XB200_144M:
77 | _xb200_filter = bladerf_xb200_filter.BLADERF_XB200_144M;
78 | break;
79 | case (int)bladerf_xb200_filter.BLADERF_XB200_222M:
80 | _xb200_filter = bladerf_xb200_filter.BLADERF_XB200_222M;
81 | break;
82 | case (int)bladerf_xb200_filter.BLADERF_XB200_AUTO_1DB:
83 | _xb200_filter = bladerf_xb200_filter.BLADERF_XB200_AUTO_1DB;
84 | break;
85 | case (int)bladerf_xb200_filter.BLADERF_XB200_AUTO_3DB:
86 | _xb200_filter = bladerf_xb200_filter.BLADERF_XB200_AUTO_3DB;
87 | break;
88 | default:
89 | _xb200_filter = bladerf_xb200_filter.BLADERF_XB200_CUSTOM;
90 | break;
91 | }
92 | }
93 | }
94 |
95 | public string FPGAImage
96 | {
97 | get { return _fpga_path; }
98 | set { _fpga_path = value; }
99 | }
100 |
101 | public int Sampling
102 | {
103 | get { return (int)_sampling; }
104 | set
105 | {
106 | switch (value)
107 | {
108 | case (int)bladerf_sampling.BLADERF_SAMPLING_UNKNOWN:
109 | _sampling = bladerf_sampling.BLADERF_SAMPLING_UNKNOWN;
110 | break;
111 | case (int)bladerf_sampling.BLADERF_SAMPLING_INTERNAL:
112 | _sampling = bladerf_sampling.BLADERF_SAMPLING_INTERNAL;
113 | break;
114 | case (int)bladerf_sampling.BLADERF_SAMPLING_EXTERNAL:
115 | _sampling = bladerf_sampling.BLADERF_SAMPLING_EXTERNAL;
116 | break;
117 | default:
118 | _sampling = bladerf_sampling.BLADERF_SAMPLING_UNKNOWN;
119 | break;
120 | }
121 | if (_dev != IntPtr.Zero)
122 | {
123 | NativeMethods.bladerf_set_sampling(_dev, _sampling);
124 | }
125 | }
126 | }
127 |
128 | public uint Index
129 | {
130 | get
131 | {
132 | return 0;
133 | }
134 | }
135 |
136 | public string Serial
137 | {
138 | get { return _serial; }
139 | }
140 |
141 | public string Name
142 | {
143 | get
144 | {
145 | return DeviceName;
146 | }
147 | }
148 |
149 | public uint LNAGain
150 | {
151 | get
152 | {
153 | return (uint)_lnaGain;
154 | }
155 | set
156 | {
157 | switch (value)
158 | {
159 | case (uint)bladerf_lna_gain.BLADERF_LNA_GAIN_BYPASS:
160 | _lnaGain = bladerf_lna_gain.BLADERF_LNA_GAIN_BYPASS;
161 | break;
162 | case (uint)bladerf_lna_gain.BLADERF_LNA_GAIN_MID:
163 | _lnaGain = bladerf_lna_gain.BLADERF_LNA_GAIN_MID;
164 | break;
165 | case (uint)bladerf_lna_gain.BLADERF_LNA_GAIN_MAX:
166 | _lnaGain = bladerf_lna_gain.BLADERF_LNA_GAIN_MAX;
167 | break;
168 | default:
169 | _lnaGain = bladerf_lna_gain.BLADERF_LNA_GAIN_UNKNOWN;
170 | break;
171 | }
172 | if (_dev != IntPtr.Zero)
173 | NativeMethods.bladerf_set_lna_gain(_dev, _lnaGain);
174 | }
175 | }
176 |
177 | public int VGA1Gain
178 | {
179 | get
180 | {
181 | return _vga1Gain;
182 | }
183 | set
184 | {
185 | _vga1Gain = value;
186 | if (_dev != IntPtr.Zero)
187 | NativeMethods.bladerf_set_rxvga1(_dev, _vga1Gain);
188 | }
189 | }
190 |
191 | public int VGA2Gain
192 | {
193 | get
194 | {
195 | return _vga2Gain;
196 | }
197 | set
198 | {
199 | _vga2Gain = value;
200 | if (_dev != IntPtr.Zero)
201 | NativeMethods.bladerf_set_rxvga2(_dev, _vga2Gain);
202 | }
203 | }
204 |
205 | public double SampleRate
206 | {
207 | get
208 | {
209 | return _sampleRate;
210 | }
211 | set
212 | {
213 | _sampleRate = value;
214 | if (_dev != IntPtr.Zero)
215 | {
216 | double actual;
217 | if (0 == NativeMethods.bladerf_set_sample_rate(_dev, bladerf_module.BLADERF_MODULE_RX, _sampleRate, out actual))
218 | _sampleRate = actual;
219 | adjustReadLength();
220 | uint tmp = 0;
221 | if (_bandwidth == 0)
222 | NativeMethods.bladerf_set_bandwidth(_dev, bladerf_module.BLADERF_MODULE_RX, (uint)(_sampleRate * 0.75), out tmp);
223 | }
224 | OnSampleRateChanged();
225 | }
226 | }
227 |
228 | private void adjustReadLength()
229 | {
230 | lock (syncLock)
231 | {
232 | if (_sampleRate <= 1000000)
233 | _readLength = 4096U;
234 | else if (_sampleRate <= 10000000)
235 | _readLength = 16384U;
236 | else
237 | _readLength = 32768U;
238 | }
239 | }
240 |
241 | public event EventHandler SampleRateChanged;
242 |
243 | public void OnSampleRateChanged()
244 | {
245 | if (SampleRateChanged != null)
246 | SampleRateChanged(this, EventArgs.Empty);
247 | }
248 |
249 | public int Bandwidth
250 | {
251 | get
252 | {
253 | if (_bandwidth != 0)
254 | return _bandwidth;
255 | if (_dev != IntPtr.Zero)
256 | {
257 | uint tmp;
258 | if (0 == NativeMethods.bladerf_get_bandwidth(_dev, bladerf_module.BLADERF_MODULE_RX, out tmp))
259 | return (int) tmp;
260 | }
261 | return Math.Min(MaxBandwidth, Math.Max((int)(0.75 * _sampleRate), MinBandwidth));
262 | }
263 |
264 | set
265 | {
266 | _bandwidth = value;
267 | if (_dev != IntPtr.Zero)
268 | {
269 | uint tmp;
270 | if (value == 0)
271 | NativeMethods.bladerf_set_bandwidth(_dev, bladerf_module.BLADERF_MODULE_RX, (uint) (0.75 * _sampleRate), out tmp);
272 | else
273 | NativeMethods.bladerf_set_bandwidth(_dev, bladerf_module.BLADERF_MODULE_RX, (uint) value, out tmp);
274 | }
275 | }
276 | }
277 |
278 | public long Frequency
279 | {
280 | get
281 | {
282 | return _centerFrequency;
283 | }
284 | set
285 | {
286 | uint real_frequency;
287 | _centerFrequency = value;
288 | if (_centerFrequency < MinFrequency && _xb200_enabled == false)
289 | _centerFrequency = MinFrequency;
290 | if (_centerFrequency > MaxFrequency)
291 | _centerFrequency = MaxFrequency;
292 | if (_dev != IntPtr.Zero)
293 | {
294 | if (_xb200_filter == bladerf_xb200_filter.BLADERF_XB200_AUTO)
295 | XB200AdjustFilterBank();
296 | NativeMethods.bladerf_set_frequency(_dev, bladerf_module.BLADERF_MODULE_RX, (uint)_centerFrequency);
297 | NativeMethods.bladerf_get_frequency(_dev, bladerf_module.BLADERF_MODULE_RX, out real_frequency);
298 | _centerFrequency = real_frequency;
299 | }
300 | }
301 | }
302 |
303 | public bool IsStreaming
304 | {
305 | get
306 | {
307 | return _isStreaming;
308 | }
309 | }
310 |
311 | static unsafe BladeRFDevice()
312 | {
313 | _lutPtr = (float*)_lutBuffer;
314 | const float scale = 1.0f / 2048.0f;
315 | for (int i = 0; i < 4096; ++i)
316 | {
317 | _lutPtr[i] = (((i + 2048) % 4096) - 2048) * scale;
318 | }
319 | }
320 |
321 | public BladeRFDevice(string serial = "")
322 | {
323 | _isFpgaLoaded = false;
324 | string devspec = "";
325 | if (serial != "")
326 | devspec = String.Format("*:serial={0}", serial);
327 | var rv = NativeMethods.bladerf_open(out _dev, devspec);
328 | if (rv != 0)
329 | throw new ApplicationException(String.Format("Cannot open BladeRF device. Is the device locked somewhere?. {0}", NativeMethods.bladerf_strerror(rv)));
330 | _devSpec = devspec;
331 | _gcHandle = GCHandle.Alloc(this);
332 | if (serial == "")
333 | if ((rv = NativeMethods.bladerf_get_serial(_dev, out serial)) != 0)
334 | throw new ApplicationException(String.Format("bladerf_get_serial() error. {0}", NativeMethods.bladerf_strerror(rv)));
335 | _serial = serial;
336 | DeviceName = String.Format("BladeRF SN#{0}", serial);
337 | NativeMethods.bladerf_close(_dev);
338 | _dev = IntPtr.Zero;
339 | #if DEBUG
340 | NativeMethods.bladerf_log_set_verbosity(bladerf_log_level.BLADERF_LOG_LEVEL_VERBOSE);
341 | #endif
342 | }
343 |
344 | ~BladeRFDevice()
345 | {
346 | Dispose();
347 | }
348 |
349 | private void LoadFPGA()
350 | {
351 | if (!_isFpgaLoaded)
352 | {
353 | if (_dev == IntPtr.Zero)
354 | if (0 != NativeMethods.bladerf_open(out _dev, _devSpec))
355 | _dev = IntPtr.Zero;
356 | if (_dev != IntPtr.Zero)
357 | {
358 | if (0 == NativeMethods.bladerf_is_fpga_configured(_dev))
359 | {
360 | if (_fpga_path == "")
361 | throw new ApplicationException("FPGA image is not set");
362 | if (0 == NativeMethods.bladerf_load_fpga(_dev, _fpga_path))
363 | {
364 | _isFpgaLoaded = true;
365 | }
366 | }
367 | else
368 | _isFpgaLoaded = true;
369 | }
370 | else
371 | {
372 | _isFpgaLoaded = false;
373 | }
374 | }
375 | }
376 |
377 | public void Dispose()
378 | {
379 | Stop();
380 | if (_gcHandle.IsAllocated)
381 | {
382 | _gcHandle.Free();
383 | }
384 | _dev = IntPtr.Zero;
385 | GC.SuppressFinalize(this);
386 | }
387 |
388 | public event SamplesAvailableDelegate SamplesAvailable;
389 |
390 | private unsafe void ReceiveSamples_sync()
391 | {
392 | int status = 0;
393 | while (_isStreaming)
394 | {
395 | uint cur_len, new_len;
396 | lock (syncLock)
397 | {
398 | cur_len = new_len = _readLength;
399 | }
400 | if (_iqBuffer == null || _iqBuffer.Length != cur_len)
401 | {
402 | _iqBuffer = UnsafeBuffer.Create((int)cur_len, sizeof(Complex));
403 | _iqPtr = (Complex*)_iqBuffer;
404 | }
405 | if (_samplesBuffer == null || _samplesBuffer.Length != (2 * cur_len))
406 | {
407 | _samplesBuffer = UnsafeBuffer.Create((int)(2 * cur_len), sizeof(Int16));
408 | _samplesPtr = (Int16*)_samplesBuffer;
409 | }
410 | if ((status = NativeMethods.bladerf_sync_config(_dev, bladerf_module.BLADERF_MODULE_RX, bladerf_format.BLADERF_FORMAT_SC16_Q11, NumBuffers, cur_len, NumBuffers / 2, SampleTimeoutMs)) != 0)
411 | _isStreaming = false;
412 | lock(syncLock)
413 | {
414 | _RXConfigured = true;
415 | }
416 | while (status == 0 && cur_len == new_len)
417 | {
418 | try
419 | {
420 | status = NativeMethods.bladerf_sync_rx(_dev, _samplesPtr, cur_len, IntPtr.Zero, SampleTimeoutMs);
421 | if (status != 0)
422 | throw new ApplicationException(String.Format("bladerf_rx() error. {0}", NativeMethods.bladerf_strerror(status)));
423 | var ptrIq = _iqPtr;
424 | var ptrSample = _samplesPtr;
425 | for (int i = 0; i < cur_len; i++)
426 | {
427 | ptrIq->Real = _lutPtr[*ptrSample & 0x0fff];
428 | ptrSample++;
429 | ptrIq->Imag = _lutPtr[*ptrSample & 0x0fff];
430 | ptrSample++;
431 | ptrIq++;
432 | }
433 | ComplexSamplesAvailable(_iqPtr, _iqBuffer.Length);
434 | }
435 | catch
436 | {
437 | break;
438 | }
439 | lock (syncLock)
440 | {
441 | new_len = _readLength;
442 | }
443 | }
444 | }
445 | }
446 |
447 | private void XB200AdjustFilterBank()
448 | {
449 | if (_dev == IntPtr.Zero)
450 | return;
451 | if (!_xb200_enabled)
452 | return;
453 | if (_centerFrequency >= MinFrequency)
454 | return;
455 | int error = 0;
456 | FrequencyRange filter50M_freqs = new FrequencyRange(50000000, 54000000);
457 | FrequencyRange filter144M_freqs = new FrequencyRange(149000000, 159000000);
458 | FrequencyRange filter222M_freqs = new FrequencyRange(206000000, 235000000);
459 | switch (_xb200_filter)
460 | {
461 | case bladerf_xb200_filter.BLADERF_XB200_AUTO_1DB:
462 | filter50M_freqs.Min = 37774405;
463 | filter50M_freqs.Max = 59535436;
464 | filter144M_freqs.Min = 128326173;
465 | filter144M_freqs.Max = 166711171;
466 | filter222M_freqs.Min = 187593160;
467 | filter222M_freqs.Max = 245346403;
468 | break;
469 | case bladerf_xb200_filter.BLADERF_XB200_AUTO_3DB:
470 | filter50M_freqs.Min = 34782924;
471 | filter50M_freqs.Max = 61899260;
472 | filter144M_freqs.Min = 121956957;
473 | filter144M_freqs.Max = 178444099;
474 | filter222M_freqs.Min = 177522675;
475 | filter222M_freqs.Max = 260140935;
476 | break;
477 | }
478 | if (filter50M_freqs.contains(_centerFrequency))
479 | {
480 | error = NativeMethods.bladerf_xb200_set_filterbank(_dev, bladerf_module.BLADERF_MODULE_RX, bladerf_xb200_filter.BLADERF_XB200_50M);
481 | }
482 | else if (filter144M_freqs.contains(_centerFrequency))
483 | {
484 | error = NativeMethods.bladerf_xb200_set_filterbank(_dev, bladerf_module.BLADERF_MODULE_RX, bladerf_xb200_filter.BLADERF_XB200_144M);
485 | }
486 | else if (filter222M_freqs.contains(_centerFrequency))
487 | {
488 | error = NativeMethods.bladerf_xb200_set_filterbank(_dev, bladerf_module.BLADERF_MODULE_RX, bladerf_xb200_filter.BLADERF_XB200_222M);
489 | }
490 | else
491 | {
492 | error = NativeMethods.bladerf_xb200_set_filterbank(_dev, bladerf_module.BLADERF_MODULE_RX, bladerf_xb200_filter.BLADERF_XB200_CUSTOM);
493 | }
494 |
495 | if (error != 0)
496 | throw new ApplicationException(String.Format("bladerf_xb200_set_filterbank() error. {0}", NativeMethods.bladerf_strerror(error)));
497 | }
498 |
499 | public unsafe void Start()
500 | {
501 | int error;
502 | if (_isStreaming)
503 | throw new ApplicationException("Start() Already running");
504 | if (_dev == IntPtr.Zero)
505 | {
506 | int ret;
507 | if ((ret = NativeMethods.bladerf_open(out _dev, _devSpec)) == 0)
508 | {
509 | LoadFPGA();
510 | }
511 | else
512 | {
513 | _dev = IntPtr.Zero;
514 | throw new ApplicationException(String.Format("Masked bladerf_open() error. {0}", NativeMethods.bladerf_strerror(ret)));
515 | }
516 | }
517 | if (_dev == IntPtr.Zero)
518 | throw new ApplicationException("Cannot open device");
519 | if (_isFpgaLoaded == false)
520 | throw new ApplicationException("FPGA not loaded");
521 | double actual;
522 | if ((error = NativeMethods.bladerf_set_sample_rate(_dev, bladerf_module.BLADERF_MODULE_RX, _sampleRate, out actual)) != 0)
523 | throw new ApplicationException(String.Format("bladerf_sample_set_sample_rate() error. {0}", NativeMethods.bladerf_strerror(error)));
524 | _sampleRate = actual;
525 | adjustReadLength();
526 | uint tmp = 0;
527 | if (_bandwidth == 0)
528 | {
529 | if ((error = NativeMethods.bladerf_set_bandwidth(_dev, bladerf_module.BLADERF_MODULE_RX, (uint)(_sampleRate * 0.75), out tmp)) != 0)
530 | throw new ApplicationException(String.Format("bladerf_set_bandwidth() error. {0}", NativeMethods.bladerf_strerror(error)));
531 | }
532 | else
533 | {
534 | if ((error = NativeMethods.bladerf_set_bandwidth(_dev, bladerf_module.BLADERF_MODULE_RX, (uint) _bandwidth, out tmp)) != 0)
535 | throw new ApplicationException(String.Format("bladerf_set_bandwidth() error. {0}", NativeMethods.bladerf_strerror(error)));
536 | }
537 | if ((error = NativeMethods.bladerf_set_loopback(_dev, bladerf_loopback.BLADERF_LB_NONE)) != 0)
538 | throw new ApplicationException(String.Format("bladerf_set_loopback() error. {0}", NativeMethods.bladerf_strerror(error)));
539 | if ((error = NativeMethods.bladerf_set_sampling(_dev, _sampling)) != 0)
540 | throw new ApplicationException(String.Format("bladerf_sampling() error. {0}", NativeMethods.bladerf_strerror(error)));
541 | if ((error = NativeMethods.bladerf_set_lpf_mode(_dev, bladerf_module.BLADERF_MODULE_RX, bladerf_lpf_mode.BLADERF_LPF_NORMAL)) != 0)
542 | throw new ApplicationException(String.Format("bladerf_set_lpf_mode() error. {0}", NativeMethods.bladerf_strerror(error)));
543 | if ((error = NativeMethods.bladerf_set_lna_gain(_dev, _lnaGain)) != 0)
544 | throw new ApplicationException(String.Format("bladerf_set_lna_gain() error. {0}", NativeMethods.bladerf_strerror(error)));
545 | if ((error = NativeMethods.bladerf_set_rxvga1(_dev, _vga1Gain)) != 0)
546 | throw new ApplicationException(String.Format("bladerf_set_rxvga1() error. {0}", NativeMethods.bladerf_strerror(error)));
547 | if ((error = NativeMethods.bladerf_set_rxvga2(_dev, _vga2Gain)) != 0)
548 | throw new ApplicationException(String.Format("bladerf_set_rxvga2() error. {0}", NativeMethods.bladerf_strerror(error)));
549 | if (_xb200_enabled)
550 | {
551 | if ((error = NativeMethods.bladerf_xb200_attach(_dev)) != 0)
552 | throw new ApplicationException(String.Format("bladerf_xb200_attach() error. {0}", NativeMethods.bladerf_strerror(error)));
553 | if (_xb200_filter == bladerf_xb200_filter.BLADERF_XB200_AUTO)
554 | {
555 | XB200AdjustFilterBank();
556 | }
557 | else
558 | {
559 | if ((error = NativeMethods.bladerf_xb200_set_filterbank(_dev, bladerf_module.BLADERF_MODULE_RX, _xb200_filter)) != 0)
560 | {
561 | if (_xb200_filter == bladerf_xb200_filter.BLADERF_XB200_AUTO_1DB || _xb200_filter == bladerf_xb200_filter.BLADERF_XB200_AUTO_3DB)
562 | XB200AdjustFilterBank();
563 | else
564 | throw new ApplicationException(String.Format("bladerf_xb200_set_filterbank() error. {0}", NativeMethods.bladerf_strerror(error)));
565 | }
566 | }
567 | }
568 | if ((error = NativeMethods.bladerf_set_frequency(_dev, bladerf_module.BLADERF_MODULE_RX, (uint)_centerFrequency)) != 0)
569 | throw new ApplicationException(String.Format("bladerf_set_frequency() error. {0}", NativeMethods.bladerf_strerror(error)));
570 | if (_version.major == 0 && _version.minor < 14)
571 | {
572 | throw new ApplicationException(String.Format("libbladerf is too old. Got {0} and expecting at least v0.14", _version.describe));
573 | }
574 | else
575 | {
576 | // new sync interface
577 | _sampleThread = new Thread(ReceiveSamples_sync);
578 | _sampleThread.Name = "bladerf_samples_rx";
579 | _sampleThread.Priority = ThreadPriority.Highest;
580 | _isStreaming = true;
581 | _sampleThread.Start();
582 | bool ready = false;
583 | while (!ready)
584 | {
585 | lock (syncLock)
586 | {
587 | ready = _RXConfigured;
588 | }
589 | }
590 | if ((error = NativeMethods.bladerf_enable_module(_dev, bladerf_module.BLADERF_MODULE_RX, 1)) != 0)
591 | throw new ApplicationException(String.Format("bladerf_enable_module() error. {0}", NativeMethods.bladerf_strerror(error)));
592 | }
593 | }
594 |
595 | public void Stop()
596 | {
597 | if (_isStreaming)
598 | {
599 | int error;
600 | _isStreaming = false;
601 | if ((error = NativeMethods.bladerf_enable_module(_dev, bladerf_module.BLADERF_MODULE_RX, 0)) != 0)
602 | throw new ApplicationException(String.Format("Disabling RX module failed: {0}", NativeMethods.bladerf_strerror(error)));
603 | }
604 |
605 | if (_sampleThread != null)
606 | {
607 | if (_sampleThread.ThreadState == ThreadState.Running)
608 | _sampleThread.Join();
609 | _sampleThread = null;
610 | }
611 |
612 | if (_dev != IntPtr.Zero)
613 | {
614 | NativeMethods.bladerf_close(_dev);
615 | _dev = IntPtr.Zero;
616 | }
617 | }
618 |
619 | private unsafe void ComplexSamplesAvailable(Complex* buffer, int length)
620 | {
621 | if (SamplesAvailable != null)
622 | {
623 | _eventArgs.Buffer = buffer;
624 | _eventArgs.Length = length;
625 | SamplesAvailable(this, _eventArgs);
626 | }
627 | }
628 |
629 | private sealed class FrequencyRange
630 | {
631 | private long _min, _max;
632 | public FrequencyRange(long min, long max)
633 | {
634 | _min = min;
635 | _max = max;
636 | }
637 |
638 | public long Min
639 | {
640 | get { return _min; }
641 | set { _min = value; }
642 | }
643 |
644 | public long Max
645 | {
646 | get { return _max; }
647 | set { _max = value; }
648 | }
649 |
650 | public bool contains(long frequency)
651 | {
652 | return (Min <= frequency) && (frequency <= Max);
653 | }
654 | }
655 | }
656 |
657 | public delegate void SamplesAvailableDelegate(object sender, SamplesAvailableEventArgs e);
658 |
659 | public unsafe sealed class SamplesAvailableEventArgs : EventArgs
660 | {
661 | public int Length { get; set; }
662 | public Complex* Buffer { get; set; }
663 | }
664 | }
665 |
--------------------------------------------------------------------------------