HidControllerWinRT.h
Go to the documentation of this file.
//-----------------------------------------------------------------------------
//
// HidControllerImpl.h
//
// WinRT implementation of a HidController
//
// Copyright (c) 2015 Microsoft Corporation
// All rights reserved.
//
// SOFTWARE NOTICE AND LICENSE
//
// This file is part of OpenZWave.
//
// OpenZWave is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// OpenZWave is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
#ifndef _HidControllerImpl_H
#define _HidControllerImpl_H
#include <windows.h>
#include "Defs.h"
#include "platform/Controller.h"
#include <ppltasks.h>
namespace OpenZWave
{
class HidController : public Controller
{
public:
HidController();
virtual ~HidController();
bool SetVendorId(uint32 const _vendorId);
bool SetProductId(uint32 const _productId);
bool SetSerialNumber(string const& _serialNumber);
bool Open(string const& _hidControllerName);
bool Close();
uint32 Write(uint8* _buffer, uint32 _length);
private:
uint32 SendFeatureReport( uint8* _buffer, uint32 _length, unsigned short reportId );
Concurrency::task<bool> Init();
Windows::Devices::HumanInterfaceDevice::HidDevice ^ m_device;
Windows::Foundation::EventRegistrationToken m_inputReportEventToken;
uint32 m_vendorId;
uint32 m_productId;
string m_serialNumber;
string m_hidControllerName;
bool m_bOpen;
};
} // namespace OpenZWave
#endif //_HidControllerImpl_H
OpenZWave::HidController::~HidController
virtual ~HidController()
Definition: HidControllerWinRT.cpp:65
OpenZWave
Definition: Bitfield.h:34
OpenZWave::HidController::Close
bool Close()
Definition: HidControllerWinRT.cpp:170
OpenZWave::HidController::HidController
HidController()
Definition: HidControllerWinRT.cpp:52
Defs.h
OpenZWave::HidController::Open
bool Open(string const &_hidControllerName)
Definition: HidControllerWinRT.cpp:125
uint32
unsigned int uint32
Definition: Defs.h:80
OpenZWave::HidController::SetSerialNumber
bool SetSerialNumber(string const &_serialNumber)
Definition: HidControllerWinRT.cpp:110
Controller.h
OpenZWave::HidController::SetVendorId
bool SetVendorId(uint32 const _vendorId)
Definition: HidControllerWinRT.cpp:78
OpenZWave::HidController::Write
uint32 Write(uint8 *_buffer, uint32 _length)
Definition: HidControllerWinRT.cpp:239
OpenZWave::HidController::SetProductId
bool SetProductId(uint32 const _productId)
Definition: HidControllerWinRT.cpp:95
uint8
unsigned char uint8
Definition: Defs.h:74