/pps/qnx/device/device_ctrl

Control object for issuing commands to a device

Publishers
Any app
Subscribers
Device publishers (e.g., usblauncher)
Note: For more information about the device publishers and how they interact with PPS, see the Device Publishers Developer's Guide.
Note: This object is a server object, designed to process requests from individual clients and deliver the results to the clients that issued the requests. For more information, see the "Server objects" subsection.

Overview

When you start usblauncher, the following PPS object is created:

/pps/qnx/device/usb_ctrl

This object allows apps to perform actions on the USB hardware, such as setting the power state of a USB hub or launching a USB stack version.

The control object's name also includes the stack number if usblauncher is started with the -S option (which allows for multiple server objects, one for each instance of usblauncher). Suppose you issue this command:

usblauncher –S 1

The USB service creates an object named /pps/qnx/device/usb_ctrl1.

For details on the commands that apps can send to the control object and on the responses that the object publishes, see the Device Control Object reference for usblauncher.

USB control examples

After starting the usblauncher process, enter this command from a terminal:

cat /pps/qnx/device/usb_ctrl?wait,delta

Then, from a second terminal, enter these commands:

sloginfo -w &
echo toggle_port_power::x,y,z >> /ramdisk/pps/qnx/device/usb_ctrl

The first terminal shows the command status and the power result of the command for the specified bus, device, and port:

# cat usb_ctrl?wait,delta 
@usb_ctrl
port_power::0
@usb_ctrl
port_power::1
@usb_ctrl
cmd_status::0 

A value of 0 for cmd_status means no errors. If an error occurs, this attribute contains a nonzero error code. Details about the possible errors for USB control commands are found in the Device Control Object reference.