Commit graph

29 commits

Author SHA1 Message Date
Jon Szymaniak
625694eaa5 license: License changes on various portions of the codebase
Where possible (and with contributor permission), items have been
changed to LGPLv2.1 or MIT licenses to avoid issues with any proprietary
libraries from vendors (HDL and FW), allow static linking (with headless
mode operation in mind), and to generally present users with more
permissive licenses.

File headers and the COPYING have been updated accordingly. Third party
sources have been either removed, replaced, or relocated in the source
tree, in accordance with the licenses decided upon for each part of the tree.

Contributor Assignment Agreements have been added, and it is required
that these be submitted before significant patches and pull requests
are accepted.
2013-10-27 00:17:35 -04:00
Jon Szymaniak
7a1b2c1462 common, libbladeRF: log.c support can be disabled at compile-time
CMake option added to disable log.c for libbladeRF. Adjustments made
to other files as needed to address warnings (becoming errors via
-Werror and /Wx).

Removed return values for log-related functions, as these were unused
and made it slightly more annoying to make this change. The libbladeRF
minor version has been bumped to note this change in the currently
unstable series v0.x.x series.
2013-10-21 22:44:59 -04:00
Jon Szymaniak
8c057b61fa libbladeRF, utils: Moving ezusb code out of lib into utils
With future license-related cleanup, all GPLv2 programs will live
in the utilities directory. As such, ezusb.c has been moved out
of the library, and the bladeRF-cli utility has been modified to
use this directly.
2013-10-21 21:05:17 -04:00
Jon Szymaniak
dce050890d bladeRF-cli: rx/tx now use async interface, libbladeRF: USB dev speed API call
The rx and tx CLI commands now use the asynchronous stream interface to
yield more acceptable performance, and this code has been overhauled for
better readability. Command parameters have been added to allow for
configuration of the stream.

Although a bit overzealous, as "lock it if you use it" approach is taken
here. Optimizations may follow later..

Some rx/tx parameters now support K/M/G suffixes, where relevant.

To support sample rate sanity checks, an API function to check the
current USB speed has been added to libbladeRF. This speed is now
reported in the CLI 'info' command.
2013-10-14 22:42:19 -04:00
Jon Szymaniak
ab36a93813 libbbladeRF, utilities: Migrating to major.minor.patch for version #'s
The API now presents a version structure that includes major, minor, and
patch versions. It additionally provides a "describe" string which
includes these version items in a string format, with any additional
annotations (such as git revision and dirty flag).

This changeset removes the older version functions, breaking reverse
compatibility (intentionally). Bumped minor version to reflect this change.
(The 0.Y.Z series is considered unstable at this time.)
2013-10-03 22:50:43 -04:00
Brian Padalino
9dad2af0de Windows: Call Sleep() with a value > 0.
From the documentation:

"A value of zero causes the thread to relinquish the remainder of its
time slice to any other thread of equal priority that is ready to run.
If there are no other threads of equal priority ready to run, the
function returns immediately, and the thread continues execution."

Thanks Simon!
2013-09-29 12:05:14 -04:00
litghost
abe064cea8 Fixes for Windows build warnings on VS2012 2013-09-27 16:31:37 +00:00
Keith Rothman
57116c919a [FX3/libbladeRF] Major refactoring of FX3 application
- Split RF, FPGA load, and firmware methods into seperate .c files
 - Split several vendor requests to eliminate magic glEp0Idx and to allow
   for better error handling
   - Updated libbladeRF to use new vendor requests and properly check return
     code.
 - Changed glSpiPageSize from global to #define
 - Move OTP handling into firmware.c
 - Version bump

Conflicts:

	fx3_firmware/bladeRF.c
2013-09-22 08:06:48 +00:00
Jon Szymaniak
9015bdbb5c libbladeRF, bladeRF-flash: Added device identifier info matching to API routines
Initializing, extracting, and comparing device identifier information
(struct bladerf_devinfo) is now exposed through the API. Among other
things, this allow users to check if a device specifier string matches a
device they already have a handle for.

To support this, a copy of bladerf_devinfo information is now kept around in
the device handle; backends are responsible for populating this in their
open() implementation. A couple of the fields were already present, so
this only adds a couple small variables worth of overhead.

Some re-arranging of the linux and libusb probe and open calls has been done
to achieve this. A few warnings and bugs were addressed in this process:

  - The Linux backend was attempting to fill in a serial number via
    a cached entry.

  - There was some potential for a read of an uninitialized portion
    of an otp buffer.

  - Missing serial # has been made non-fatal. (Some developers'
    device do not have serial numbers.)

Files associated with this functionality was moved from host/common
back into the library, which should now be used instead. bladeRF-flash
has been updated to use these new API functions.
2013-09-18 23:15:48 -04:00
Nuand
264fb4428e Merge pull request #103 from litghost/windows_build_fix
[test_repeater] Fixed windows build
2013-09-15 00:00:37 -07:00
litghost
c5c3cb11a2 [test_repeater] Fixed windows build 2013-09-14 23:22:11 -07:00
Robert Ghilduta
e9bc007b39 host_config.h.in: fix Sleep() argument
Windows' Sleep() function expects the argument to be specified in milliseconds
2013-09-14 23:19:13 -07:00
Keith Rothman
b530c7266d Initial version of bladeRF-flash tool 2013-09-15 05:32:04 +00:00
Keith Rothman
1c4fa232eb [libbladeRF/bladeRF-cli] Added support booting directly from the FX3 bootloader 2013-09-15 05:31:57 +00:00
Jon Szymaniak
2dcae9eeb2 libbladeRF & common: Renamed logging routines to address conflicts
The common logging functions have been renamed in order to not
conflict with the library's bladerf_log_set_verbosity().
2013-09-11 00:29:14 -04:00
Brian Padalino
9e0be95110 Merge branch 'issue66' of https://github.com/frank8371/bladeRF into frank8371-issue66
Enhancement to support suffixes on the command line.
2013-09-05 20:19:16 -04:00
Robert Ghilduta
c28acaed83 fix Windows string format function usage 2013-09-04 20:27:38 -05:00
Frank Jenner
2761491a58 Added support for suffixes on numeric values
Added a new conversion function that accepts a list of suffix to
multiplier mappings, and applies the appropriate multiplier to the input
value. Utilized this new conversion function in the CLI for set
bandwidth, set samplerate, and set frequency.
2013-09-04 20:37:15 -04:00
Jon Szymaniak
b0d82cc95e host common: Corrected return type for str2uint64 2013-09-04 19:22:14 -04:00
Jon Szymaniak
9c6892c130 host: Disabled file and line information from log messages by default.
This information (which is helpful when asking questions on IRC or
in the forums), can be enabled via the CMake argument,
     -DENABLE_LOG_FILE_INFO=ON
2013-09-04 01:33:41 -04:00
Jon Szymaniak
9252dea908 bladeRF-cli: Fixed struct field initializers and removed use of unistd.h 2013-09-03 00:19:46 -04:00
Jon Szymaniak
b30446293e Added pthreads-win32, and getopt/getopt_long to Windows build. 2013-09-03 00:19:39 -04:00
Jon Szymaniak
985a8a4548 libbladeRF: Added API_EXPORT for API routines. 2013-09-03 00:02:58 -04:00
Jon Szymaniak
fe19d9af62 Remapped a few functions, types, and macros. Moved declarations.
These items address compilation issues under VS2012.
2013-09-02 23:22:56 -04:00
Frank Jenner
3655b3d516 Added variable-level logging mechanism
Added a mechanism to log messages with different priority levels, and to
filter which messages are output by setting a threshold level. The
function to set the current log level/verbosity is exposed through
libbladeRF.h, while the logging function/macros themselves are private
to this project, and are present in log.c/log.h. Callers should use the
convenience macros bladerf_log_[level]() to issue their log messages.
These macros piece together a format string that contains the message
priority and, for warning and higher priorities, the function and line
number on which the message was logged. Also, warning level and higher
level messages are output to stderr, rather than stdout.
2013-09-02 15:39:41 -04:00
Jon Szymaniak
d394f68084 host: Fixed build items broken by Windows build-related commits.
This includes freqmod's fixes provided in pull request/issue #57,
in addition to some other misc. cleanup items noted while reviewing
the aforementioned changset.
2013-08-25 11:16:07 -04:00
Jon Szymaniak
71641d1198 host: Fixed a handful of Windows build issues. May break Linux build. 2013-08-25 01:14:24 -04:00
Jon Szymaniak
4a322888bb host: Added stdbool.h for msvc builds 2013-08-24 18:22:15 -04:00
Jon Szymaniak
4f0808a635 host: Minor rearrangement of the host-common directory 2013-08-24 18:13:23 -04:00