Loading...
Searching...
No Matches
Functions for scanning available contexts

## Data Structures

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

## Functions

__api __check_ret struct iio_scan_context * | iio_create_scan_context (const char *backend, unsigned int flags)
| Create a scan context.
__api void | iio_scan_context_destroy (struct iio_scan_context *ctx)
| Destroy the given scan context.
__api __check_ret ssize_t | iio_scan_context_get_info_list (struct iio_scan_context *ctx, struct iio_context_info ***info)
| Enumerate available contexts.
__api void | iio_context_info_list_free (struct iio_context_info **info)
| Free a context info list.
__api __check_ret __pure const char * | iio_context_info_get_description (const struct iio_context_info *info)
| Get a description of a discovered context.
__api __check_ret __pure const char * | iio_context_info_get_uri (const struct iio_context_info *info)
| Get the URI of a discovered context.
__api struct iio_scan_block * | iio_create_scan_block (const char *backend, unsigned int flags)
| Create a scan block.
__api void | iio_scan_block_destroy (struct iio_scan_block *blk)
| Destroy the given scan block.
__api ssize_t | iio_scan_block_scan (struct iio_scan_block *blk)
| Enumerate available contexts via scan block.
__api struct iio_context_info * | iio_scan_block_get_info (struct iio_scan_block *blk, unsigned int index)
| Get the iio_context_info for a particular context.

## Detailed Description

## Function Documentation

## iio_context_info_get_description()

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

Get a description of a discovered context.

Parameters

  info | A pointer to an iio_context_info structure

Returns
  A pointer to a static NULL-terminated string

Examples
  iio-monitor.c.

## iio_context_info_get_uri()

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

Get the URI of a discovered context.

Parameters

  info | A pointer to an iio_context_info structure

Returns
  A pointer to a static NULL-terminated string

Examples
  iio-monitor.c.

## iio_context_info_list_free()

__api void iio_context_info_list_free | ( | struct iio_context_info ** | info | ) |

Free a context info list.

Parameters

  info | A pointer to a 'const struct iio_context_info *' typed variable

Examples
  iio-monitor.c.

Here is the caller graph for this function:

## iio_create_scan_block()

__api struct iio_scan_block * iio_create_scan_block | ( | const char * | backend,
|  | unsigned int | flags )

Create a scan block.

Parameters

  backend | A NULL-terminated string containing the backend to use for scanning. If NULL, all the available backends are used.
  flags | Unused for now. Set to 0.

Returns
  on success, a pointer to a iio_scan_block structure
  On failure, NULL is returned and errno is set appropriately

Introduced in version 0.20.

Here is the call graph for this function:

## iio_create_scan_context()

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

Create a scan context.

Parameters

  backend | A NULL-terminated string containing a comma-separated list of the backend(s) to use for scanning.
  flags | Unused 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

NOTE: Libiio version 0.20 and above can handle multiple strings, for instance "local:usb:", "ip:usb:", "local:usb:ip:", and require a colon as the delimiter. Libiio version 0.24 and above prefer a comma instead of colon as the delimiter, and handle specifying backend-specific information. For instance, "local,usb=0456:*" will scan the local backend and limit scans on USB to vendor ID 0x0456, and accept all product IDs. The "usb=0456:b673" string would limit the scan to the device with this particular VID/PID. Both IDs are expected in hexadecimal, no 0x prefix needed.

Examples
  iio-monitor.c.

Here is the caller graph for this function:

## iio_scan_block_destroy()

__api void iio_scan_block_destroy | ( | struct iio_scan_block * | blk | ) |

Destroy the given scan block.

Parameters

  blk | A pointer to an iio_scan_block structure

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

Introduced in version 0.20.

Here is the call graph for this function:

## iio_scan_block_get_info()

__api struct iio_context_info * iio_scan_block_get_info | ( | struct iio_scan_block * | blk,
|  | unsigned int | index )

Get the iio_context_info for a particular context.

Parameters

  blk | A pointer to an iio_scan_block structure
  index | The index corresponding to the context.

Returns
  A pointer to the iio_context_info for the context
  On success, a pointer to the specified iio_context_info
  On failure, NULL is returned and errno is set appropriately

Introduced in version 0.20.

## iio_scan_block_scan()

__api ssize_t iio_scan_block_scan | ( | struct iio_scan_block * | blk | ) |

Enumerate available contexts via scan block.

Parameters

  blk | A pointer to a iio_scan_block structure.

Returns
  On success, the number of contexts found.
  On failure, a negative error number.

Introduced in version 0.20.

Here is the call graph for this function:

## iio_scan_context_destroy()

__api void iio_scan_context_destroy | ( | struct iio_scan_context * | ctx | ) |

Destroy the given scan context.

Parameters

  ctx | A pointer to an iio_scan_context structure

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

Examples
  iio-monitor.c.

Here is the caller graph for this function:

## iio_scan_context_get_info_list()

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

Enumerate available contexts.

Parameters

  ctx | A pointer to an iio_scan_context structure
  info | A 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.

Examples
  iio-monitor.c.

Here is the call graph for this function:
Here is the caller graph for this function: