This CLSID returns the current crankshaft rotation rate.
Engine RPM
Read, shareable or exclusive
Type: | VT_UI2 (unsigned short) |
Low: | 0 |
High: | 16,383 |
None
Type: | VT_UI2 (unsigned short) |
Measurement: | VIOMEASUREMENT_ROTATIONALSPEED |
Units: | VIOUNITS_RPM |
API device objects expect the following data types and sizes when sending data to and from the mini-drivers:
None
Type: | USHORT * |
Size: | 2 bytes |
Description: | Engine revolutions per minute (RPM) |
HRESULT hr;
IVIO_Device *pEngineRPM;
//Create the event sink; CEngineRPMSink is derived from //IVIO_EventSink.
IVIO_EventSink *iRpmSink = new CEngineRPMSink;
//Create an instance of the engine RPM device and get its
//IVIO_Device interface.
hr = CoCreateInstance(CLSID_VIO_ENGINE_RPM, NULL,
CLSCTX_INPROC_SERVER, IID_VIODEVICE,
&pEngineRPM);
//Set the notification sink to notify every half second.
pEngineRPM->SetNotify(NULL, iRpmSink, 500);
.
.
. //Turn off the notification sink.
pVehicleSpeed->SetNotify(NULL, NULL, 0);
//Release the reference to the event sink.
iRpmSink->Release();
//Release the reference to the interface.
pEngineRPM->Release();