libiio: Functions for scanning available contexts

libiio 1.0 Library for interfacing with IIO devices

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

## Functions
__api __check_ret struct iio_scan * | iio_scan (const struct iio_context_params *params, const char *backends)
| Scan backends for IIO contexts.
__api void | iio_scan_destroy (struct iio_scan *ctx)
| Destroy the given scan context.
__api __check_ret __pure size_t | iio_scan_get_results_count (const struct iio_scan *ctx)
| Get number of results of a scan operation.
__api __check_ret __pure const char * | iio_scan_get_description (const struct iio_scan *ctx, size_t idx)
| Get description of scanned context.
__api __check_ret __pure const char * | iio_scan_get_uri (const struct iio_scan *ctx, size_t idx)
| Get URI of scanned context.

## Detailed Description

## Function Documentation

## ◆ iio_scan()

__api __check_ret struct iio_scan * iio_scan | ( | const struct iio_context_params * | params,
|  | const char * | backends
| ) |  |

Scan backends for IIO contexts.

Parameters

  params | A pointer to a iio_context_params structure that contains context creation information; can be NULL
  backends | a NULL-terminated string containing a comma-separated list of the backends to be scanned for contexts. If NULL, all the available backends are scanned.

Returns
  On success, a pointer to an iio_scan structure
  On failure, a pointer-encoded error is returned

NOTE: It is possible to provide 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.

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

## ◆ iio_scan_destroy()

__api void iio_scan_destroy | ( | struct iio_scan * | ctx | ) |

Destroy the given scan context.

Parameters

  ctx | A pointer to an iio_scan structure

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

## ◆ iio_scan_get_description()

__api __check_ret __pure const char * iio_scan_get_description | ( | const struct iio_scan * | ctx,
|  | size_t | idx
| ) |  |

Get description of scanned context.

Parameters

  ctx | A pointer to an iio_scan structure
  idx | The index of the scanned context

Returns
  On success, a pointer to a NULL-terminated string
  If the index is invalid, NULL is returned

## ◆ iio_scan_get_results_count()

__api __check_ret __pure size_t iio_scan_get_results_count | ( | const struct iio_scan * | ctx | ) |

Get number of results of a scan operation.

Parameters

  ctx | A pointer to an iio_scan structure

Returns
  The number of results of the scan operation

## ◆ iio_scan_get_uri()

__api __check_ret __pure const char * iio_scan_get_uri | ( | const struct iio_scan * | ctx,
|  | size_t | idx
| ) |  |

Get URI of scanned context.

Parameters

  ctx | A pointer to an iio_scan structure
  idx | The index of the scanned context

Returns
  On success, a pointer to a NULL-terminated string
  If the index is invalid, NULL is returned