Commit graph

29 commits

Author SHA1 Message Date
Rey Tucker
14c4cfeda1 host: common: add loopback2str conversion (#40)
Implements a loopback2str() function to convert a bladerf_loopback into a C string.

Also, formatting fixes by clang-format
2018-05-22 13:00:03 -04:00
Rey Tucker
14e7f317a2 host: common/conversions: add str2channel
Converts from a string to a bladerf_channel
2018-02-05 15:35:28 -05:00
Vanya A. Sergeev
9062b66d9c libbladeRF: migrate bladerf_module to bladerf_channel and bladerf_direction 2017-12-21 12:54:58 -05:00
Robert Ghilduta
82c424cc8c Add string manipulation functions 2017-12-07 20:34:33 -08:00
Robert Ghilduta
38664eaa10 Add bladeRF and libbladeRF specific look-ups and conversion 2017-12-07 17:10:28 -08:00
Robert Ghilduta
579199768c Cleanup files to add options file parser 2017-12-07 17:10:28 -08:00
Jon Szymaniak
210591e8e2 host: common: Added conversion routines for bladerf_smb_mode 2016-05-17 00:20:01 -04:00
Jon Szymaniak
7656724db7 host: common: Added trigger role conversion routines 2016-05-17 00:20:01 -04:00
Jon Szymaniak
8c0ac5629d host/common: Added string <-> trigger enum conversion functions 2016-05-17 00:19:53 -04:00
Jon Szymaniak
3537c3a49a host: common: Added str2bool() conversion routine
This is intended for use with functions that require
enable/disable, on/off, true/false.
2016-04-25 19:03:34 -04:00
Jon Szymaniak
279db7aee4 host/common: Added missing extern "C" { ... } in headers 2016-01-11 23:01:20 -05:00
Jon Szymaniak
454b4931ec host/common: Added str to bladerf_module & bladerf_dc_cal_module fns 2015-12-28 22:20:20 -05:00
Jon Szymaniak
672cf27eae host/common: Added string to uint64 and double w/ suffix conversions 2015-10-08 12:48:55 -04:00
Jon Szymaniak
3cfb507f91 host_common: Use size_t for array length, MSVC build fix
size_t or unsigned int are preferred for variables that describe
the length of an array.

This change fixes an additional MSVC build issue caused by
test_scheduled_retune.
2015-06-21 22:52:19 -04:00
Jon Szymaniak
cd6cb0cca7 host/common: Added SC16Q11 <-> float conversion routines 2015-04-10 13:39:09 -04:00
Jon Szymaniak
41bcf7b12c host: Centralized duplicated code
Moved function to get string description to conversions.c.

There's a similar function within libbladeRF's backend.c, but that
is intended to be used in the device information string; this is
intended to be a bit more humand-readable.
2014-12-18 17:58:21 -05:00
Jon Szymaniak
7218273716 libbladeRF_test: Added common cmdline arg handling and device config
Most of the libbladeRF_test items contain their own command line
argument handling, yielding repeated code and inconsistent invocations.

This commit introduces common command-line argument handling and device
configuration for the most used device parameters.

Future patches will migrate the tests over to using this functionality.
New tests should use this immediately.
2014-11-18 17:09:11 -05:00
Jon Szymaniak
c4d5bbe8b4 bladeRF-cli: Added '#' end-of-line comment
All characters following '#' are ignored as part of an end-of-line
comment.

Thank you to Karl Lehenbauer for suggesting this change.
2014-08-15 01:47:36 -04:00
Jon Szymaniak
a151ba4f99 bladeRF-cli: Handle unterminated quote as a non-fatal error condition
And additional return value has been added to str2args in order to
differentiate between an unexpected fatal (e.g, memory) error and
unterminated quotes.

This was previously causing cmd_handle() to fall through to an
"Unknown error" case, which is treated as a fatal error, resulting in
the CLI being terminated.

Thank you to Jens Elofsson (jenselo) for tracking down and reporting the
underlying defect! (Issue #259)
2014-06-30 01:34:00 -04:00
Jon Szymaniak
ffb54863b2 libbladeRF: Added loopback and clean SIGTERM handling to test_sync 2014-03-08 19:55:21 -05:00
Jon Szymaniak
daaa2e92c8 libbladeRF: Re-implemented sync interface, updated API docs, renamed timeout function
The sync interface has been re-implemented atop the existing
asynchronous interface. This is currently opt-in and only enable when
pthreads support is enabled and available.

Some clarifications have been made in the API documentation,
specifically in the explanations of the various stream parameters.

The bladerf_set_transfer_timeout and bladerf_get_transfer_timeout have
been named more appropriately, as these control stream transfer
timeouts, as opposed to all transfers.
2014-03-08 19:55:21 -05:00
Jon Szymaniak
12a4313cc1 bladeRF-cli: Improved script support, quoted param support, misc. cleanup
Scripts can be invoked from within other scripts, using the "run"
command. An error is reported if a recursive loop is detected.

An "echo" command has been added for debug purposes.

Parameters may now be surrounded in double quotes to include spaces.

Removed extraneous error messages from main(); The preceding functions
print error messages if needed.

Removed error-out if no device is attached. This allows scripts to be
run if the device is not attached. Commands already verify that a device
is attached, if required.
2013-11-11 22:14:53 -05:00
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
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
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
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
Jon Szymaniak
4f0808a635 host: Minor rearrangement of the host-common directory 2013-08-24 18:13:23 -04:00
Renamed from host/common/conversions.h (Browse further)