libiio  0.11
Library for interfacing with IIO devices
Data Structures | Functions
Functions for scanning available contexts

Data Structures

struct  iio_context_info
 The information related to a discovered context. More...
 

Functions

__api struct iio_scan_context * iio_create_scan_context (const char *backend, unsigned int flags)
 Create a scan context. More...
 
__api void iio_scan_context_destroy (struct iio_scan_context *ctx)
 Destroy the given scan context. More...
 
__api ssize_t iio_scan_context_get_info_list (struct iio_scan_context *ctx, struct iio_context_info ***info)
 Enumerate available contexts. More...
 
__api void iio_context_info_list_free (struct iio_context_info **info)
 Free a context info list. More...
 
__api __pure const char * iio_context_info_get_description (const struct iio_context_info *info)
 Get a description of a discovered context. More...
 
__api __pure const char * iio_context_info_get_uri (const struct iio_context_info *info)
 Get the URI of a discovered context. More...
 

Detailed Description

Function Documentation

◆ iio_context_info_get_description()

__api __pure const char* iio_context_info_get_description ( const struct iio_context_info info)

Get a description of a discovered context.

Parameters
infoA pointer to an iio_context_info structure
Returns
A pointer to a static NULL-terminated string

◆ iio_context_info_get_uri()

__api __pure const char* iio_context_info_get_uri ( const struct iio_context_info info)

Get the URI of a discovered context.

Parameters
infoA pointer to an iio_context_info structure
Returns
A pointer to a static NULL-terminated string

◆ iio_context_info_list_free()

__api void iio_context_info_list_free ( struct iio_context_info **  info)

Free a context info list.

Parameters
infoA pointer to a 'const struct iio_context_info *' typed variable

◆ iio_create_scan_context()

__api struct iio_scan_context* iio_create_scan_context ( const char *  backend,
unsigned int  flags 
)

Create a scan context.

Parameters
backendA NULL-terminated string containing the backend to use for scanning. If NULL, all the available backends are used.
flagsUnused for now. Set to 0.
Returns
on success, a pointer to a iio_scan_context structure
On failure, NULL is returned and errno is set appropriately

◆ iio_scan_context_destroy()

__api void iio_scan_context_destroy ( struct iio_scan_context *  ctx)

Destroy the given scan context.

Parameters
ctxA pointer to an iio_scan_context structure

NOTE: After that function, the iio_scan_context pointer shall be invalid.

◆ iio_scan_context_get_info_list()

__api ssize_t iio_scan_context_get_info_list ( struct iio_scan_context *  ctx,
struct iio_context_info ***  info 
)

Enumerate available contexts.

Parameters
ctxA pointer to an iio_scan_context structure
infoA pointer to a 'const struct iio_context_info **' typed variable. The pointed variable will be initialized on success.
Returns
On success, the number of contexts found.
On failure, a negative error number.