libm2k
Functions
ContextBuilder

Creates/destroys the context. More...

Collaboration diagram for ContextBuilder:

Functions

LIBM2K_API M2klibm2k::context::m2kOpen (const char *uri)
 Open an ADALM2000 based on a given uri. More...
 
LIBM2K_API M2klibm2k::context::m2kOpen (struct iio_context *ctx, const char *uri)
 Open an ADALM2000 based on an existing iio_context and uri. More...
 
LIBM2K_API M2klibm2k::context::m2kOpen ()
 Open an ADALM2000. More...
 
LIBM2K_API std::vector< struct libm2k::CONTEXT_INFO * > libm2k::context::getContextsInfo ()
 List the information about all available contexts. More...
 
LIBM2K_API std::vector< std::string > libm2k::context::getAllContexts ()
 List all available contexts. More...
 
LIBM2K_API void libm2k::context::contextClose (Context *ctx, bool deinit=true)
 Destroy the given context. More...
 
LIBM2K_API void libm2k::context::contextCloseAll ()
 Close all the devices.
 
LIBM2K_API std::string libm2k::context::getVersion ()
 Get library version. More...
 
LIBM2K_API void libm2k::context::enableLogging (bool enable)
 Enable/disable the logging system. More...
 

Detailed Description

Creates/destroys the context.

Function Documentation

◆ contextClose()

LIBM2K_API void libm2k::context::contextClose ( Context ctx,
bool  deinit = true 
)

Destroy the given context.

Parameters
ctxThe context to be destroyed
deinitIf deinit is set to false, running contexts won't be affected

◆ enableLogging()

LIBM2K_API void libm2k::context::enableLogging ( bool  enable)

Enable/disable the logging system.

Parameters
enableIf true enable, otherwise disable

◆ getAllContexts()

LIBM2K_API std::vector<std::string> libm2k::context::getAllContexts ( )

List all available contexts.

Returns
A list containing the available contexts

◆ getContextsInfo()

LIBM2K_API std::vector<struct libm2k::CONTEXT_INFO*> libm2k::context::getContextsInfo ( )

List the information about all available contexts.

Returns
A list containing the info about available contexts

◆ getVersion()

LIBM2K_API std::string libm2k::context::getVersion ( )

Get library version.

Returns
a string containing the libm2k version

◆ m2kOpen() [1/3]

LIBM2K_API M2k* libm2k::context::m2kOpen ( const char *  uri)

Open an ADALM2000 based on a given uri.

Parameters
uriDescribe the location of the context
Returns
M2k object or nullptr if no ADALM2000 was found/available
Note
the uri can be something similar to: "ip:192.168.2.1" or "usb:1.6.5"

◆ m2kOpen() [2/3]

LIBM2K_API M2k* libm2k::context::m2kOpen ( struct iio_context *  ctx,
const char *  uri 
)

Open an ADALM2000 based on an existing iio_context and uri.

Parameters
ctxA pointer to an iio_context structure
uriDescribe the location of the context
Returns
M2k object or nullptr if no ADALM2000 was found/available
Note
the uri can be something similar to: "ip:192.168.2.1" or "usb:1.6.5"

◆ m2kOpen() [3/3]

LIBM2K_API M2k* libm2k::context::m2kOpen ( )

Open an ADALM2000.

Returns
M2k object or nullptr if no ADALM2000 was found/available
Note
this will try to open USB connected devices