User Tools

Site Tools


uphp:functions:getusbstat

This is an old revision of the document!


getusbstat

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Get USB host status information

Description

array getusbstat ( )

Return an array containing information about the state of the USB interface

Parameters

None

Return Value

Array containing the following keys and values:

KEYTYPEVALUE
enabledint1 if USB support is enabled, 0 if disabled
statestringUSB state, one of the following:
DETACHED - Device is detached
ATTACHED - Device is attached
ADDRESSING - Device is acquiring address
CONFIGURING - Device is being configured
RUNNING - Device is running
HOLDING - Device is holding
STATE=x - Other state (x)
VIDintUSB Device VID (16bit)
PIDintUSB Device PID (16bit)
devicestringName of the device (if a driver is found)
CDC1)int1 if the device supports CDC, otherwise 0

Example

<?
  $arr=getusbstat();
  print("USB device ID is: ".$arr['VID'].":".$arr['PID']\r\n");
?>

See Also

setusbpower() - Set the USB host power on or off (1 or 0)

net_enable3g() - Enable USB dongle network connectivity if available

net_disable3g() - Disable USB dongle network connectivity

getethstat() - Get Ethernet connection information

1)
CDC stands for Communications Device Class, which is a composite USB device class that supports communication. The class may include more than one interface, such as a custom control interface, data interface, audio, or mass storage related interfaces. Currently the Wattmon only supports CDC devices for cellular data communication.
uphp/functions/getusbstat.1491847457.txt.gz · Last modified: 2021/09/13 05:56 (external edit)