summaryrefslogtreecommitdiff
path: root/wpd/WpdBasicHardwareDriver/WpdBaseDriver.h
diff options
context:
space:
mode:
authorJ M Rossy <[email protected]>2015-07-29 15:40:09 -0700
committerJ M Rossy <[email protected]>2015-07-29 16:34:40 -0700
commit5d61a4a79a1e96dc5d9af1e5e712c84507307544 (patch)
tree49ed270893578cd18758b74ffcca16dc7ab948d6 /wpd/WpdBasicHardwareDriver/WpdBaseDriver.h
parent5d41613e26e147d2300c786bb2b34cb4b4067a25 (diff)
Samples update for public Windows 10 release
Fix #2 Enabling WPP Recorder in Sensors Samples causes errors Fix #4 Add back fixed KMDOD sample Add new BarcodeScanner sample in pos folder Add new MagneticStripeReader sample in pos folder Add new SynpaticsTouch sample in input folder Add new Power Engine Plugin sample in pofx folder Add new DeviceMft sample in avstream folder Add new AvsCamera sample in root Add new SimBatt sample in root Add other pre-existing samples not yet released for Win10
Diffstat (limited to 'wpd/WpdBasicHardwareDriver/WpdBaseDriver.h')
-rw-r--r--wpd/WpdBasicHardwareDriver/WpdBaseDriver.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/wpd/WpdBasicHardwareDriver/WpdBaseDriver.h b/wpd/WpdBasicHardwareDriver/WpdBaseDriver.h
new file mode 100644
index 00000000..13dd4694
--- /dev/null
+++ b/wpd/WpdBasicHardwareDriver/WpdBaseDriver.h
@@ -0,0 +1,69 @@
+#pragma once
+
+typedef struct tagSENSOR_INFO{
+ unsigned char deviceID;
+ unsigned short dataLength;
+} SENSOR_INFO;
+
+class WpdBaseDriver :
+ public IUnknown
+{
+public:
+ WpdBaseDriver();
+ virtual ~WpdBaseDriver();
+
+ HRESULT Initialize(_In_ IWDFDevice *pDevice);
+ void Uninitialize();
+
+ HRESULT DispatchWpdMessage(_In_ IPortableDeviceValues* pParams,
+ _In_ IPortableDeviceValues* pResults);
+
+ HRESULT ProcessReadData(_In_reads_(cbData) BYTE* pData, size_t cbData);
+
+ RS232Target* GetRS232Target();
+
+public: // IUnknown
+ ULONG __stdcall AddRef();
+
+ _At_(this, __drv_freesMem(Mem))
+ ULONG __stdcall Release();
+
+ HRESULT __stdcall QueryInterface(REFIID riid, void** ppv);
+
+private:
+ HRESULT OnGetObjectIDsFromPersistentUniqueIDs(_In_ IPortableDeviceValues* pParams,
+ _In_ IPortableDeviceValues* pResults);
+
+ HRESULT PostSensorReadingEvent(LONGLONG llSensorData, DWORD dwUpdateInterval);
+
+public:
+
+ enum SensorType{
+ UNKNOWN, // Unknown
+ COMPASS, // Compass
+ SENSIRON, // Temp/humidity sensor
+ FLEX, // Flexiforce sensor
+ PING, // Ultrasonic ping
+ PIR, // Passive infrared
+ MEMSIC, // 2-axis accelerometer
+ QTI, // Light sensor
+ PIEZO, // Vibration Sensor
+ HITACHI, // 3-axis accelerometer
+ };
+
+ SensorType m_SensorType; // enum value specifying sensor type
+
+private:
+ WpdObjectEnumerator m_ObjectEnum;
+ WpdObjectProperties m_ObjectProperties;
+ WpdCapabilities m_Capabilities;
+
+ ULONG m_cRef;
+ RS232Connection m_Connection;
+ RS232Target m_Target;
+
+ CComPtr<IWDFDevice> m_pWDFDevice;
+ CComPtr<IWpdSerializer> m_pWpdSerializer;
+ CComPtr<IPortableDeviceValues> m_pEventParams;
+};
+