Date: Fri, 29 Mar 2024 15:56:36 +0000 (UTC)
Message-ID: <1775954295.17933.1711727796306@localhost>
Subject: Exported From Confluence
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_17932_691593837.1711727796306"
------=_Part_17932_691593837.1711727796306
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Location: file:///C:/exported.html
libusbctrl
libusbctrl
Supports USB detection and control functionality to enable =
USB detection and control from application. This ensures that the USB port =
works as expected before using peripherals and capabilities that use the US=
B port.
Functionality
- Support for USB hot plug detection & Control from service manager m=
odule
- Notifies application via Service Manager when device is connected to US=
B port, including device type (and make / model if available).
- Provides software control via Service Manager to enable/disable USB por=
t.
- Allows multiple USB devices to connect via USB hub.
- Upon initialization, libusbctrl scan the existing devices and start mon=
itor hotplug events.
Sample Control Flow
- usbctl is loaded. It initializes data structures to store callbacks.
- App calls registerCallback()
- App calls init()=20
- usbctrl initializes internal data structures.
- usbctrl launches hotplug monitoring task.
- usbctl enumerates all usb_interface device types and assigns a unique n=
umber to each interface.
- Each interface is entered into a list of structs. Each struct has the u=
nique identifier and the interface-specifier
- usbctrl launches callback for each interface with "add" event.
- Callback is allowed to internally call other usbctrl APIs to get proper=
ties.
- When a getProperty() call is received, usbctrl compares unique identifi=
er against its internal data structures and validates.=20
- if unique identifier is valid,
- if property is defined by interface, return that.
- if property is not defined by interface, iterate up the USB hierarchy t=
o find one that does and return the value.
- App calls term()
- usbctrl stops monitoring of hotplug events.
- usbctrl clears data structures storing callbacks and usb_interfaces.
------=_Part_17932_691593837.1711727796306--