pub unsafe extern "C" fn iio_create_context_from_uri(
    uri: *const c_char
) -> *mut iio_context
Expand description

@brief Create a context from a URI description @param uri A URI describing the context location @return On success, a pointer to a iio_context structure @return On failure, NULL is returned and errno is set appropriately

NOTE: The following URIs are supported based on compile time backend support:

  • Local backend, “local:”\n Does not have an address part. For example “local:”
  • XML backend, “xml:”\n Requires a path to the XML file for the address part. For example “xml:/home/user/file.xml”
  • Network backend, “ip:”\n 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”
  • USB backend, “usb:”\n 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:”\n 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 (‘\0’ none, ‘x’ Xon Xoff, ‘r’ RTSCTS, ‘d’ DTRDSR)

For example “serial:/dev/ttyUSB0,115200” or “serial:/dev/ttyUSB0,115200,8n1”