OpenZWave Library 1.4.0
Loading...
Searching...
No Matches
HidControllerWinRT.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2//
3// HidControllerImpl.h
4//
5// WinRT implementation of a HidController
6//
7// Copyright (c) 2015 Microsoft Corporation
8// All rights reserved.
9//
10// SOFTWARE NOTICE AND LICENSE
11//
12// This file is part of OpenZWave.
13//
14// OpenZWave is free software: you can redistribute it and/or modify
15// it under the terms of the GNU Lesser General Public License as published
16// by the Free Software Foundation, either version 3 of the License,
17// or (at your option) any later version.
18//
19// OpenZWave is distributed in the hope that it will be useful,
20// but WITHOUT ANY WARRANTY; without even the implied warranty of
21// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22// GNU Lesser General Public License for more details.
23//
24// You should have received a copy of the GNU Lesser General Public License
25// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
26//
27//-----------------------------------------------------------------------------
28
29#ifndef _HidControllerImpl_H
30#define _HidControllerImpl_H
31
32#include <windows.h>
33
34#include "Defs.h"
35#include "platform/Controller.h"
36#include <ppltasks.h>
37
38namespace OpenZWave
39{
40 class HidController : public Controller
41 {
42 public:
43
49
54 virtual ~HidController();
55
62 bool SetVendorId(uint32 const _vendorId);
63
70 bool SetProductId(uint32 const _productId);
71
78 bool SetSerialNumber(string const& _serialNumber);
79
87 bool Open(string const& _hidControllerName);
88
95 bool Close();
96
105 uint32 Write(uint8* _buffer, uint32 _length);
106
107 private:
108
109 uint32 SendFeatureReport( uint8* _buffer, uint32 _length, unsigned short reportId );
110 Concurrency::task<bool> Init();
111
112 Windows::Devices::HumanInterfaceDevice::HidDevice ^ m_device;
113 Windows::Foundation::EventRegistrationToken m_inputReportEventToken;
114
115 uint32 m_vendorId;
116 uint32 m_productId;
117 string m_serialNumber;
118 string m_hidControllerName;
119 bool m_bOpen;
120 };
121
122} // namespace OpenZWave
123
124#endif //_HidControllerImpl_H
125
unsigned int uint32
Definition Defs.h:80
unsigned char uint8
Definition Defs.h:74
Definition Controller.h:42
Definition HidController.h:48
bool SetVendorId(uint32 const _vendorId)
bool SetProductId(uint32 const _productId)
bool Open(string const &_hidControllerName)
bool SetSerialNumber(string const &_serialNumber)
uint32 Write(uint8 *_buffer, uint32 _length)
Definition Bitfield.h:35