This CLSID returns the current vehicle speed.
Vehicle speed
Read, shareable or exclusive
Type: | VT_UI2 (unsigned short) |
Low: | 0 |
High: | 383 |
None
Type: | VT_UI2 (unsigned short) |
Measurement: | VIOMEASUREMENT_SPEED |
Units: | VIOUNITS_KILOMETERSPERHOUR |
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: | Vehicle speed in kilometers per hour |
HRESULT hr;
IVIO_Device *pVehicleSpeed;
//Create the event sink - CVehicleSpeedSink is derived from //IVIO_EventSink.
IVIO_EventSink *iSpeedSink = new CVehicleSpeedSink;
//Create an instance of the vehicle speed device and get its
//IVIO_Device interface.
hr = CoCreateInstance(CLSID_VIO_VEHICLE_SPEED, NULL,
CLSCTX_INPROC_SERVER, IID_VIODEVICE,
&pVehicleSpeed);
//Set the notification sink to notify every half second.
pVehicleSpeed->SetNotify(NULL, iSpeedSink, 500);
.
.
//Turn off the notification sink.
pVehicleSpeed->SetNotify(NULL, NULL, 0);
//Release the reference to the vehicle speed device.
pVehicleSpeed->Release();
//Release the reference to the event sink.
iSpeedSink->Release();