Contains the representation of a generic IIO context.
More...
Contains the representation of a generic IIO context.
◆ getAllDevices()
virtual std::unordered_set<std::string> libm2k::context::Context::getAllDevices |
( |
| ) |
const |
|
pure virtual |
Retrieve all the available devices.
- Returns
- a list of strings containing all the devices
◆ getAllDmm()
Retrieve all the DMM objects.
- Returns
- A list of DMM objects
◆ getAvailableContextAttributes()
virtual std::vector<std::string> libm2k::context::Context::getAvailableContextAttributes |
( |
| ) |
|
|
pure virtual |
Retrieve all the available context attributes.
- Returns
- A list of strings containing all the context attributes
◆ getContextAttributeValue()
virtual std::string libm2k::context::Context::getContextAttributeValue |
( |
std::string |
attr | ) |
|
|
pure virtual |
Retrieve the value of one context attribute.
- Parameters
-
attr | The name of the required attribute |
- Returns
- On success, return a string containing the value of the attribute
- Exceptions
-
On | error, throw an exception if the attribute is not found |
◆ getContextDescription()
virtual std::string libm2k::context::Context::getContextDescription |
( |
| ) |
|
|
pure virtual |
Retrieve a detailed context description.
- Returns
- string containing the current context description
◆ getDMM() [1/2]
Retrieve the DMM object at a certain index.
- Parameters
-
index | The index corresponding to the DMM |
- Returns
- On success, a pointer to a DMM object
-
On error, nullptr is returned
◆ getDMM() [2/2]
Retrieve the DMM object which has the provided name.
- Parameters
-
name | The name corresponding to the DMM |
- Returns
- On success, a pointer to a DMM object
-
On error, nullptr is returned
◆ getDmmCount()
virtual unsigned int libm2k::context::Context::getDmmCount |
( |
| ) |
|
|
pure virtual |
Retrieve the number of DMM objects.
- Returns
- an unsigned int representing the number of DMM objects in the context
◆ getFirmwareVersion()
virtual std::string libm2k::context::Context::getFirmwareVersion |
( |
| ) |
|
|
pure virtual |
Retrieve the firmware version of the current context.
- Returns
- a string containing the firmware version
◆ getIioContext()
virtual struct iio_context* libm2k::context::Context::getIioContext |
( |
| ) |
|
|
pure virtual |
Retrieve the iio context
- Returns
- A pointer to the iio context
◆ getIioContextVersion()
◆ getSerialNumber()
virtual std::string libm2k::context::Context::getSerialNumber |
( |
| ) |
|
|
pure virtual |
Retrieve the current context serial number.
- Returns
- string containing the current context serial number
◆ getUri()
virtual std::string libm2k::context::Context::getUri |
( |
| ) |
|
|
pure virtual |
Get the URI of the current context.
- Returns
- string containing the context URI (ex: "usb:1.2.3", "ip:192.168.2.1")
◆ logAllAttributes()
virtual void libm2k::context::Context::logAllAttributes |
( |
| ) |
const |
|
pure virtual |
Log all the attributes.
- Note
- The logging system should be enabled
◆ setTimeout()
virtual void libm2k::context::Context::setTimeout |
( |
unsigned int |
timeout | ) |
|
|
pure virtual |
Set a timeout for I/O operations.
- Parameters
-
timeout | A positive integer representing the time in milliseconds after which a timeout occurs. A value of 0 is used to specify that no timeout should occur. |
◆ toGeneric()
virtual Generic* libm2k::context::Context::toGeneric |
( |
| ) |
|
|
pure virtual |
Convert the current context to Generic context, if possible.
- Returns
- On success, return the corresponding Generic object
-
On error, return a nullptr
◆ toM2k()
virtual M2k* libm2k::context::Context::toM2k |
( |
| ) |
|
|
pure virtual |
Convert the current context to M2k context, if possible.
- Returns
- On success, return the corresponding M2k object
-
On error, return a nullptr