Sample Code
Windows Driver Samples/ SpbAccelerometer Sample Driver (UMDF Version 1)/ C++/ SensorDevice.idl/
//----------------------------------------------------------------------- // <copyright file="SensorDevice.idl" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> // // Module: // SensorDevice.idl // // Description: // This is the interface definition file for the Sensor // Device Library. It provides a interfaces and objects // to assist in Sensor UMDF driver developement. // //----------------------------------------------------------------------- cpp_quote("#if (_WIN32_WINNT >= 0x0600) // Windows Vista and later") import "oaidl.idl"; import "wudfddi.idl"; import "PortableDeviceTypes.idl"; // Enum for data update mode typedef enum DATA_UPDATE_MODE { DataUpdateModeOff, DataUpdateModePolling, DataUpdateModeEventing, } DATA_UPDATE_MODE, *PDATA_UPDATE_MODE; // Forward declaration interface ISensorDeviceCallback; [ object, uuid(28925cad-66f8-406c-b242-676ceaf7eaf5), helpstring("ISensorDevice Interface"), pointer_default(unique) ] interface ISensorDevice : IUnknown { HRESULT Initialize( [in] IWDFDevice* pWdfDevice, [in] IWDFCmResourceList * pWdfResourcesRaw, [in] IWDFCmResourceList * pWdfResourcesTranslated, [in] ISensorDeviceCallback* pSensorDeviceCallback ); HRESULT ConfigureHardware( ); HRESULT SetDataUpdateMode( [in] enum DATA_UPDATE_MODE Mode ); HRESULT SetReportInterval( [in] ULONG ReportInterval ); HRESULT SetChangeSensitivity( [in] PROPVARIANT* pVar ); HRESULT RequestNewData( [in] IPortableDeviceValues* pValues ); HRESULT GetTestProperty( [in] REFPROPERTYKEY key, [out] PROPVARIANT* pVar ); HRESULT SetTestProperty( [in] REFPROPERTYKEY key, [in] PROPVARIANT* pVar ); }; [ object, uuid(7ae1f8fa-a2b7-40ea-a30a-47e5455caf00), helpstring("ISensorDeviceCallback Interface"), pointer_default(unique) ] interface ISensorDeviceCallback : IUnknown { HRESULT OnNewData( [in] IPortableDeviceValues* pValues ); }; [ uuid(72c7613e-8d77-4a23-adc9-89fbff76bcae), version(1.0), helpstring("Accelerometer Device Type Library") ] library AccelerometerDeviceLibrary { importlib("stdole2.tlb"); [ uuid(fc319403-37fc-442a-98b9-ef05ce9c13f0), helpstring("AccelerometerDevice Class") ] coclass AccelerometerDevice { [default] interface ISensorDevice; }; }; cpp_quote("#endif // (_WIN32_WINNT >= 0x0600)")
Our Services
-
What our customers say about us?
Read our customer testimonials to find out why our clients keep returning for their projects.
View Testimonials