This CLSID returns the absolute air pressure in the intake manifold.
Manifold air pressure
Read, shareable or exclusive
Type: | VT_UI2 (unsigned short integer) |
Low: | 0 = vacuum |
High: | 255 |
None
Type: | VT_UI2 (unsigned short integer) |
Measurement: | VIOMEASUREMENT_ABSOLUTEPRESSURE |
Units: | VIOUNITS_KILOPASCALSABSOLUTE |
API device objects expect the following data types and sizes when sending data to and from the mini-drivers:
None
Type: | SHORT * |
Size: | 2 bytes |
Description: | Absolute pressure in kilopascals |
HRESULT hr;
IVIO_Device *pManifoldPressure;
VARIANT vDeviceData;
USHORT usAbsolutePressure;
const SHORT c_sStdSeaLevelPressure = 101;
SHORT sVacuum;
//Create an instance of the manifold air pressure device and get its
//IVIO_Device interface.
hr = CoCreateInstance(CLSID_VIO_MANIFOLD_AIR_PRESSURE, NULL,
CLSCTX_INPROC_SERVER, IID_VIODEVICE,
&pManifoldPressure);
//Ask the device for manifold pressure.
pManifoldPressure->GetData(&vDeviceData, 3000);
//Fetch the air pressure, in kilopascals, from the VARIANT.
usAbsolutePressure = vDeviceData.uiVal;
//Calculate the amount of vacuum from standard atmospheric pressure.
sVacuum = (SHORT) usAbsolutePressure - cStdSeaLevelPressure;
//Release the reference to the interface.
pManifoldPressure->Release();