This CLSID returns the status of the ignition switch.
Ignition switch
Read, shareable or exclusive
Type: | VT_UI4 (unsigned long) |
The following table shows possible bitmask values.
Ignition switch status |
Bitmask value |
VIOIGNITIONSWITCH_OFF | 0x00 |
VIOIGNITIONSWITCH_RUN | 0x01 |
VIOIGNITIONSWITCH_START | 0x02 |
VIOIGNITIONSWITCH_ACC | 0x04 |
None
Type: | VT_UI4 (unsigned long bitmask) |
Measurement: | VIOMEASUREMENT_DISCRETEMASK (bitmask) |
Units: | VIOUNITS_BITMASK |
API device objects expect the following data types and sizes when sending data to and from the mini-drivers:
None
Type: | DWORD * |
Size: | 4 bytes |
Description: | Bitmask that contains VIOIGNITIONSWITCH_* values. |
HRESULT hr;
IVIO_Device *pIgnitionSwitch;
VARIANT vDeviceData;
ULONG ulSwitchStatus;
//Create an instance of the ignition switch device component and get its //IVIO_Device interface.
hr = CoCreateInstance(CLSID_VIO_IGNITION_SWITCH, NULL,
CLSCTX_INPROC_SERVER, IID_VIODEVICE,
&pIgnitionSwitch);
//Ask the device for its current status bits.
pIgnitionSwitch->GetData(&vDeviceData, 1000);
//Fetch the status bits from the VARIANT.
ulSwitchStatus = vDeviceData.ulVal;
//Release the reference to the interface.
pIgnitionSwitch->Release();