libbladeRF  1.1.0
Nuand bladeRF library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions
Device identifier information functions

Functions

API_EXPORT void CALL_CONV bladerf_init_devinfo (struct bladerf_devinfo *info)
 
API_EXPORT int CALL_CONV bladerf_get_devinfo (struct bladerf *dev, struct bladerf_devinfo *info)
 
API_EXPORT int CALL_CONV bladerf_get_devinfo_from_str (const char *devstr, struct bladerf_devinfo *info)
 
API_EXPORT bool CALL_CONV bladerf_devinfo_matches (const struct bladerf_devinfo *a, const struct bladerf_devinfo *b)
 
API_EXPORT bool CALL_CONV bladerf_devstr_matches (const char *dev_str, struct bladerf_devinfo *info)
 
API_EXPORT const char *CALL_CONV bladerf_backend_str (bladerf_backend backend)
 

Detailed Description

As the functions in this section do not operate on a device, there are no internal thread-safety concerns. The caller only needs to ensure the function parameters are not modified while these functions are executing.

Function Documentation

API_EXPORT const char* CALL_CONV bladerf_backend_str ( bladerf_backend  backend)

Retrieve the backend string associated with the specified backend enumeration value.

Warning
Do not attempt to modify or free() the returned string.
Returns
A string that can used to specify the backend portion of a device identifier string. (See bladerf_open().)
API_EXPORT bool CALL_CONV bladerf_devinfo_matches ( const struct bladerf_devinfo a,
const struct bladerf_devinfo b 
)

Test whether two device identifier information structures match, taking wildcard values into account.

API_EXPORT bool CALL_CONV bladerf_devstr_matches ( const char *  dev_str,
struct bladerf_devinfo info 
)

Test whether a provided device string matches a device described by the provided bladerf_devinfo structure

Parameters
[in]dev_strDevices string, formated as described in the the documentation of bladerf_open
[in]infoDevice info to compare with
Returns
true upon a match, false otherwise
API_EXPORT int CALL_CONV bladerf_get_devinfo ( struct bladerf *  dev,
struct bladerf_devinfo info 
)

Fill out a provided bladerf_devinfo structure, given an open device handle. This function is thread-safe.

Precondition
dev must be a valid device handle.
Parameters
[in]devDevice handle previously obtained with bladerf_open()
[out]infoDevice information populated by this function
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_get_devinfo_from_str ( const char *  devstr,
struct bladerf_devinfo info 
)

Populate a device identifier information structure using the provided device identifier string.

Parameters
[in]devstrDevice identifier string, formated as described in the bladerf_open() documentation
[out]infoUpon success, this will be filled out according to the provided device identifier string, with wildcards for any fields that were not provided.
Returns
0 on success, value from Error codes list on failure
API_EXPORT void CALL_CONV bladerf_init_devinfo ( struct bladerf_devinfo info)

Initialize a device identifier information structure to a "wildcard" state. The values in each field will match any value for that field.

Passing a bladerf_devinfo initialized with this function to bladerf_open_with_devinfo() will match the first device found.