Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The usbpowercontrol object is used to control the power of the USB port for specific supported platforms. The supported supported platforms are XT1144, XD1034, AU325, and AU335.  This object is available available on BrightSignOS 8.2.20 and above.

usbpowercontrol IDL

Code Block
languagejstitleusbpowercontrol IDL
interface UsbPowerControl {
    Promise<void> powerCyclePort(String friendly_name);
    Promise<void> powerCycleAllPorts();
    Promise<void> portPowerOn(String friendly_name);
    Promise<void> portPowerOff(String friendly_name);
};
Panel
borderColor#3D3D3D
bgColor#F4F4F4
titleColor#3D3D3D
borderWidth0
titleBGColor#3D3D3D
borderStylesolid

ON THIS PAGE

Table of Contents
indent20px

Object Creation

Code Block
languagejs
var UsbPowerControlClass = require("@brightsign/usbpowercontrol");
var usbPowerControl = new UsbPowerControlClass();

usbpowercontrol

Use this interface to control power on USB ports.

powerCyclePort()
Code Block
languagejs
Promise<void> powerCyclePort(String friendly_name)

Allows you to power cycle the VBus on a device that may be stuck on a specific port.

  • [String] friendly_name: The friendly name of the specific USB port.  Please refer to the table below to map friendly names to supported platforms. For example, call usbPowerControl.powerCyclePort("USB:A") to turn the USB power on port 1 of AU325 off and on again.

Platform

USB

Friendly Name

AU325

1, 2, 3, 4, 5, 6

"USB:A", "USB:B", "USB:C", "USB:D", "USB:E", "USB:F"

AU335

Type-C

"USB:A"

XD1034, XT1144

Type-C, Type-A

"USB:A", "USB:B"

powerCycleAllPorts()
Code Block
languagejs
Promise<void> powerCycleAllPorts()

Call usbPowerControl.powerCycleAllPorts() to turn the power off and on for all USB ports and power cycle all plugged in devices.

portPowerOn()
Code Block
languagejs
Promise<void> portPowerOn(String friendly_name)

Allows you to power on the specified port. 

  • [String] friendly_name: The friendly name of the specific USB port.  Please refer to the table above to map friendly names on supported platforms.

portPowerOff()
Code Block
languagejs
Promise<void> portPowerOff(String friendly_name)

Allows you to power off the specified port. 

  • [String] friendly_name: The friendly name of the specific USB port.  Please refer to the table above to map friendly names on supported platforms.

Example

This example power cycles USB:A and USB:B ports:

Code Block
languagejs
const UsbPowerControlClass = require("@brightsign/usbpowercontrol");
const usbPowerControl = new UsbPowerControlClass();

let promise = usbPowerControl.portPowerOff("USB:A");
promise.then(function(){
        console.log("A is turned off");
        return usbPowerControl.portPowerOff("USB:B");
}).then(function(){
        console.log("B is turned off");
        return usbPowerControl.portPowerOn("USB:A");
}).then(function(){
        console.log("A is back on");
        return usbPowerControl.portPowerOn("USB:B");
}).then(function(){
        console.log("B is back on" );
}).catch(function(err){
        console.log("error");
});