Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Current »

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

usbpowercontrol IDL

interface UsbPowerControl {
    Promise<void> powerCyclePort(String friendly_name);
    Promise<void> powerCycleAllPorts();
    Promise<void> portPowerOn(String friendly_name);
    Promise<void> portPowerOff(String friendly_name);
};

ON THIS PAGE

Object Creation

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

usbpowercontrol

Use this interface to control power on USB ports.

powerCyclePort()
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()
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()
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()
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:

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");
});




  • No labels