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.
Some users have shown large DC offsets. I've seen these offsets
initially but they become much more reasonable after the first
few sample buffers come out of the FPGA.
Currently DC offset appears to be +/-30 or so after running
the calibration.
In the cli, run 'cal' to run through all modules of calibration.
The ADC can be configured to sample from the internal inputs
or from the external pins. Adding the API to change the sampling
between internal and external. Also using the appropriate API
function for the CLI.
This addresses some invalid accesses reported by valgrind. However, a few issues remain:
- Accessing calibration data on a 2.0 port causes an invalid access
- The libusb backend's implemation of open() will need to be
refactored in order to support matching on serial numbers.
This is intended to simplify some portability issues, since an int
type is sufficient in the few spots where we had ssize_t.
We'll need to still add a ssize_t wrapper around the Windows
[SSIZE_T](msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx#SSIZE_T)
for use inside the library.
The _t suffix on enums has been removed, as "_t" is reserved for
POSIX types.
To avoid naming collisions, macro definitions and enumeration values are
now prefixed with at least "BLADERF_".
Also in the mix is a stubbed out "unsupported" implementation of the
stream routines for the Linux driver backend.
Added some memory allocation checks and attempts to tear down the
stream at the first sign of errors, avoiding submitting transfers
if intialization errors occurred. Also did some misc. error
code house keeping.
STREAM_ERROR has been removed. Use STREAM_SHUTTING_DOWN and the
bladerf_stream->error_code field to differentiate between a clean an
error-driven shutdown.
It appears that attempting to use the libusb backend before the FPGA is
loaded yields erroneous behavior when attempting to load the FPGA after
encountering a BLADERF_ERR_IO. (This situation requires a power on reset
of the board.) As such, an FPGA check has been added to the async test
program.
Using libusb for streams of both TX and RX. The example
tx_async test is now for both and wil save off samples
in CSV to a file. The code still needs to be audited
before it can be brought down to the mainline.