LibIIO.CLibIIO.iio_context_clone
LibIIO.CLibIIO.iio_context_destroy
LibIIO.CLibIIO.iio_context_find_device
LibIIO.CLibIIO.iio_context_get_attr
LibIIO.CLibIIO.iio_context_get_attr_value
LibIIO.CLibIIO.iio_context_get_attrs_count
LibIIO.CLibIIO.iio_context_get_description
LibIIO.CLibIIO.iio_context_get_device
LibIIO.CLibIIO.iio_context_get_devices_count
LibIIO.CLibIIO.iio_context_get_name
LibIIO.CLibIIO.iio_context_get_version
LibIIO.CLibIIO.iio_context_get_xml
LibIIO.CLibIIO.iio_context_set_timeout
LibIIO.CLibIIO.iio_create_context_from_uri
LibIIO.CLibIIO.iio_create_default_context
LibIIO.CLibIIO.iio_create_local_context
LibIIO.CLibIIO.iio_create_network_context
LibIIO.CLibIIO.iio_create_xml_context
LibIIO.CLibIIO.iio_create_xml_context_mem
LibIIO.CLibIIO.iio_context_clone
— Methodiio_context_clone(ctx)
Duplicate a pre-existing IIO context.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structure
Returns
- On success, a pointer to an
iio_context
structure - On failure, an error is raised
This function is not supported on 'usb:' contexts, since libusb can only claim the interface once. "Function not implemented" is the expected errno. Any context which is cloned, must be destroyed via calling iio_context_destroy()
See libiio
LibIIO.CLibIIO.iio_context_destroy
— Methodiio_context_destroy(ctx)
Destroy the given context.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structure
After that function, the iio_context pointer shall be invalid.
See libiio
LibIIO.CLibIIO.iio_context_find_device
— Methodiio_context_find_device(ctx, name)
Try to find a device structure by its ID, label or name.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structurename::String
: A string corresponding to the ID, label or name of the device to search for
Returns
- On success, a pointer to an
iio_device
structure - If the parameter does not correspond to the ID, label or name of any known device, an error is raised
See libiio
LibIIO.CLibIIO.iio_context_get_attr
— Methodiio_context_get_attr(ctx, index)
Retrieve the name and value of a context-specific attribute.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structureindex::Cuint
: The index corresponding to the attribute
Returns
- On success, a 3-Tuple of (0, name, value) is returned
- On error, a negative errno code is returned
Introduced in version 0.9
See libiio
LibIIO.CLibIIO.iio_context_get_attr_value
— Methodiio_context_get_attr_value(ctx, name)
Retrieve the value of a context-specific attribute.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structurename::String
: The name of the context attribute to read
Returns
- On success, a
String
with the value of the attribute - If the name does not correspond to any attribute, C_NULL is returned
Introduced in version 0.9
See libiio
LibIIO.CLibIIO.iio_context_get_attrs_count
— Methodiio_context_get_attrs_count(ctx)
Get the number of context-specific attributes.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structure
Returns
- The number of context-specific attributes
Introduced in version 0.9
See libiio
LibIIO.CLibIIO.iio_context_get_description
— Methodiio_context_get_description(ctx)
Get a description of the given context.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structure
Returns
- A
String
containing the description
The returned string will contain human-readable information about the current context.
See libiio
LibIIO.CLibIIO.iio_context_get_device
— Methodiio_context_get_device(ctx, index)
Get the device present at the given index.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structureindex::Cuint
: The index corresponding to the device
Returns
- On success, a pointer to an
iio_device
structure - If the index is invalid, an error is raised
See libiio
LibIIO.CLibIIO.iio_context_get_devices_count
— Methodiio_context_get_devices_count(ctx)
Enumerate the devices found in the given context.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structure
Returns
- The number of devices found
See libiio
LibIIO.CLibIIO.iio_context_get_name
— Methodiio_context_get_name(ctx)
Get the name of the given context.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structure
Returns
- A
String
containing the name
The returned string will be local, xml or network when the context has been created with the local, xml and network backends respectively.
See libiio
LibIIO.CLibIIO.iio_context_get_version
— Methodiio_context_get_version(ctx)
Get the version of the backend in use.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structure
Returns
- On success, A 4-Tuple of (0, major, minor, git_tag) is returned
- On error, a negative errno code is returned
See libiio
LibIIO.CLibIIO.iio_context_get_xml
— Methodiio_context_get_xml(ctx)
Obtain a XML representation of the given context.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structure
Returns
- A
String
containing the XML content.
See libiio
LibIIO.CLibIIO.iio_context_set_timeout
— Methodiio_context_set_timeout(ctx, timeout_ms)
Set a timeout for I/O operations.
Parameters
ctx::Ptr{iio_context}
: A pointer to aniio_context
structuretimeout_ms::Cuint
: 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.
Returns
- On success, 0 is returned
- On error, a negative errno code is returned
See libiio
LibIIO.CLibIIO.iio_create_context_from_uri
— Methodiio_create_context_from_uri(uri)
Create a context from an URI description.
Parameters
uri::String
: An URI describing the context location
Returns
- On success, a pointer to an
iio_context
structure - On failure, an error is raised
The following URIs are supported based on compile time backend support:
- Local backend, "local:" Does not have an address part. For example "local:"
- XML backend, "xml:" Requires a path to the XML file for the address part. For example "xml:/home/user/file.xml"
- Network backend, "ip:" Requires a hostname, IPv4, or IPv6 to connect to a specific running IIO Daemon or no address part for automatic discovery when library is compiled with ZeroConf support. For example "ip:192.168.2.1", or "ip:localhost", or "ip:" or "ip:plutosdr.local". To support alternative port numbers the standard ip:host:port format is used. A special format is required as defined in RFC2732 for IPv6 literal hostnames, (adding '[]' around the host) to use a ip:[x:x:x:x:x:x:x:x]:port format. Valid examples would be:
- ip: Any host on default port
- ip::40000 Any host on port 40000
- ip:analog.local Default port
- ip:brain.local:40000 Port 40000
- ip:192.168.1.119 Default Port
- ip:192.168.1.119:40000 Port 40000
- ip:2601:190:400:da:47b3:55ab:3914:bff1 Default Port
- ip:[2601:190:400:da:9a90:96ff:feb5:acaa]:40000 Port 40000
- USB backend, "usb:" When more than one usb device is attached, requires bus, address, and interface parts separated with a dot. For example "usb:3.32.5". Where there is only one USB device attached, the shorthand "usb:" can be used.
- Serial backend, "serial:" Requires:
- a port (/dev/ttyUSB0),
- baud_rate (default 115200)
- serial port configuration
- data bits (5 6 7 8 9)
- parity ('n' none, 'o' odd, 'e' even, 'm' mark, 's' space)
- stop bits (1 2)
- flow control ('