Confirmed users
16
edits
(→Storage: Add event handler 'onAvailableVolumeChange') |
(Removing 'storage' type but adding 'keyboard', 'mouse', and 'camera' types.) |
||
| Line 8: | Line 8: | ||
== Features == | == Features == | ||
* Enumerate available USB ports on the current device. So far supported types of USB ports include | * Enumerate available USB ports on the current device. So far supported types of USB ports include Keyboard, Mouse, Camera. | ||
* Support hot-plug detection on each USB port. | * Support hot-plug detection on each USB port. | ||
| Line 36: | Line 36: | ||
=== USB Port Interface === | === USB Port Interface === | ||
==== Basic ==== | ==== Basic ==== | ||
enum USBPortType { " | enum USBPortType { "keyboard", "mouse", "camera" }; | ||
interface USBPort : EventTarget { | interface USBPort : EventTarget { | ||
| Line 50: | Line 50: | ||
'''type''' of type USBPortType, readonly <br/> | '''type''' of type USBPortType, readonly <br/> | ||
The type of this USB port, value must be defined in the enum of USBPortType. | The type of this USB port, value must be defined in the enum of USBPortType. | ||
'''connected''' of type boolean, readonly <br/> | '''connected''' of type boolean, readonly <br/> | ||
| Line 59: | Line 59: | ||
Whenever the hardware detects connection/disconnection, a USBConnectEvent or USBDisconnectEvent against this USB port should be fired. | Whenever the hardware detects connection/disconnection, a USBConnectEvent or USBDisconnectEvent against this USB port should be fired. | ||
==== | ==== Keyboard ==== | ||
''In reality, a specific USB port may have its specific attributes and methods. And our goal is to collect the "common" ones as many as possible. However, with limited information, we will not focus on implementing hardware dependent members in this draft.'' | ''In reality, a specific USB port may have its specific attributes and methods. And our goal is to collect the "common" ones as many as possible. However, with limited information, we will not focus on implementing hardware dependent members in this draft.'' | ||
interface | interface KeyboardUSBPort : USBPort { | ||
// Possible hardware-dependent attributes. | |||
// | |||
}; | }; | ||
==== Mouse ==== | |||
interface MouseUSBPort : USBPort { | |||
// Possible hardware-dependent attributes. | |||
}; | |||
==== Camera ==== | |||
interface CameraUSBPort : USBPort { | |||
// Possible hardware-dependent attributes. | |||
}; | |||
=== USB Port Connect/Disconnect Event Interface === | === USB Port Connect/Disconnect Event Interface === | ||