Control object for devices
Applications can send certain commands to a device via its control object, which is named after the raw device (e.g., cd0_ctrl). The command format is as follows:
command::value
You can use a newline character (\n) to separate multiple commands.
Command | Values |
---|---|
eject | Slot number |
enable |
|
initialize | Slot number |
load | Slot number |
power_condition |
|
prevent_media_removal |
|
reload | Slot number |
speed |
Note:
When the disc is ejected, the drive resumes normal speed.
|
temperature_simulation |
|
temperature_state |
|
temperature_value | Number of degrees C |
unload | Slot number |
echo "eject::1" >> /pps/qnx/device/cd0_ctrl
echo "temperature_simulation::1\ntemperature_value::80\n temperature_state::1" >> /pps/qnx/device/cd0_ctrl
The /pps/device/usb_ctrl object accepts this command:
toggle_port_power::x,y,z
toggle_port_power::0,10,3 toggle_port_power::0x0,0xa,0x3 toggle_port_power::0x0,0xa,15
cat /pps/device/usb_ctrl?wait
sloginfo -w & echo toggle_port_power::xx,y,z >> /ramdisk/pps/device/usb_ctrl
The first terminal (cat usb_ctrl?wait) will show the command status and the power result (port_power::on|off) of the command for the specified bus, device, and port.
# cat usb_ctrl?wait,delta @usb_ctrl port_power::off @usb_ctrl port_power::on @usb_ctrl cmd_status::0
A value of 0 for cmd_status means no errors.
Here is a subset of possible errors:
Command status | Meaning |
---|---|
cmd_status::19 | No such device. |
port_power::unknown | Could not get status of device. |
cmd_status::5 | Could not set feature. For example, the specified port number is greater than the maximum number of available ports. |
cmd_status::48 | Not supported. For example, the specified hub doesn't support individual power switching. |