Skip to content

Commit

Permalink
Move scan_block functions into iio.h
Browse files Browse the repository at this point in the history
scan_block functions we originally required by MATLAB but these are
generally handy in other applications. Moving into the main header.

This eliminates the iio-wrapper.h file, as it is not needed anymore.
Users who want to use this in MATLAB will need to add:
before they include iio.h

Signed-off-by: Travis F. Collins <[email protected]>
Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
tfcollins authored and rgetz committed May 8, 2020
1 parent 091f970 commit bc7b11f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 46 deletions.
46 changes: 0 additions & 46 deletions bindings/matlab/iio-wrapper.h

This file was deleted.

37 changes: 37 additions & 0 deletions iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ struct iio_buffer;

struct iio_context_info;
struct iio_scan_context;
struct iio_scan_block;

/**
* @enum iio_chan_type
Expand Down Expand Up @@ -253,6 +254,42 @@ __api __check_ret __pure const char * iio_context_info_get_uri(
const struct iio_context_info *info);


/** @brief Create a scan block
* @param backend A NULL-terminated string containing the backend to use for
* scanning. If NULL, all the available backends are used.
* @param flags Unused for now. Set to 0.
* @return on success, a pointer to a iio_scan_block structure
* @return On failure, NULL is returned and errno is set appropriately */
__api struct iio_scan_block * iio_create_scan_block(
const char *backend, unsigned int flags);


/** @brief Destroy the given scan block
* @param ctx A pointer to an iio_scan_block structure
*
* <b>NOTE:</b> After that function, the iio_scan_block pointer shall be invalid. */
__api void iio_scan_block_destroy(struct iio_scan_block *blk);


/** @brief Enumerate available contexts via scan block
* @param blk A pointer to a iio_scan_block structure.
* @returns On success, the number of contexts found.
* @returns On failure, a negative error number.
*/
__api ssize_t iio_scan_block_scan(struct iio_scan_block *blk);


/** @brief Get the iio_context_info for a particular context
* @param blk A pointer to an iio_scan_block structure
* @param index The index corresponding to the context.
* @return A pointer to the iio_context_info for the context
* @returns On success, a pointer to the specified iio_context_info
* @returns On failure, NULL is returned and errno is set appropriately
*/
__api struct iio_context_info *iio_scan_block_get_info(
struct iio_scan_block *blk, unsigned int index);


/** @} *//* ------------------------------------------------------------------*/
/* ------------------------- Top-level functions -----------------------------*/
/** @defgroup TopLevel Top-level functions
Expand Down

0 comments on commit bc7b11f

Please sign in to comment.