...
The Android USB Communications API will be composed primarily of two classes: VictorUsbDevice and VictorUsbDeviceManager. These classes are implementations of the abstract VictorDevice and VictorDeviceManager interfaces provided by the VictoR Core library. The VictorUsbDevice class represents the connection interface to an individual VictoR device over a physical USB cable. This class handles all interactions with that device over the USB communications protocol, including connecting/disconnecting, reading/writing data, and subscribing/unsubscribing from events for that device like attribute (characteristic) changes and connection state changes. These interactions are implemented using a combination of the USB API provided by the Android SDK and the API provided by the USB Serial for Android library, as discussed below in the Dependencies section. The details of the specific function calls required are outlined below in the Implementation section. The VictorUsbDeviceManager manages all VictoR device connection interfaces through VictorUsbDevice objects that it creates, maintains, and destroys as needed. This class acts as the primary interface for end-users to discover devices and manage connections to them. In addition, the VictorUsbDeviceManager provides a wrapper around the functions that the VictorUsbDevice class offers, requiring only that the end-user provide the address for the specific device they are interested in interacting with, so that they don’t need to have any knowledge of the underlying organization of the devices within the manager. The class diagram in Figure 1 below illustrates the architecture of the Android USB Communications API.
...
Anchor | ||||
---|---|---|---|---|
|
...