- src.zip
- src
- tools.zip
- tools
- devcon
- amd64
- devcon.exe
- i386
- devcon.exe
- PlaneDemo
- DemoApp.exe
- DemoApp.pdb
- Microsoft.WindowsAPICodePack.dll
- Microsoft.WindowsAPICodePack.pdb
- Microsoft.WindowsAPICodePack.Sensors.dll
- Microsoft.WindowsAPICodePack.Sensors.pdb
- WiimoteTest
- WiimoteLib.dll
- WiimoteTest.exe
- i386.zip
- i386
- WiimoteSensor.dll
- WiimoteSensor.inf
- WiimoteSensor.pdb
- WUDFUpdate_01009.dll
- wiidiag.zip
- Wiidiag
- Microsoft.WindowsAPICodePack.dll
- Microsoft.WindowsAPICodePack.Sensors.dll
- Wiidiag.exe
- amd64.zip
- amd64
- WiimoteSensor.dll
- WiimoteSensor.inf
- WiimoteSensor.pdb
- WUDFUpdate_01009.dll
|
#include "internal.h"
#include "Defines.h"
#include "DeviceProperty.h"
#include "PortableDeviceProps.h"
#include "ObjectLock.h"
#include "SensorDdi.h"
#include "Sensor.h"
#include "SensorRegistry.h"
#include "SensorDevice.h"
#include "SensorDevice.tmh"
//
// implement the sensor
//
IMPLEMENT_SENSOR(CSensorDevice);
CSensorDevice::CSensorDevice(void)
{
}
CSensorDevice::~CSensorDevice(void)
{
}
HRESULT CSensorDevice::Init(IWDFDevice *pDevice, CSensorDDI *pSensorDDI)
{
CObjectLock lock(this);
//
// call the base implementation first
//
HRESULT hr = CSensor::Init(pDevice, pSensorDDI);
if(FAILED(hr))
return hr;
//
// add sensor supported properties
//
hr = m_Properties.AddProps(DEVPROPS(
MAKEPROP(WPD_DEVICE_FIRMWARE_VERSION, DEVICE_FIRMWARE_VERSION_VALUE),
MAKEPROP(WPD_DEVICE_POWER_LEVEL, DEVICE_POWER_LEVEL_VALUE),
MAKEPROP(WPD_DEVICE_POWER_SOURCE, (ULONG)WPD_POWER_SOURCE_EXTERNAL),
MAKEPROP(WPD_DEVICE_PROTOCOL, DEVICE_PROTOCOL_VALUE),
MAKEPROP(WPD_DEVICE_MODEL, DEVICE_MODEL_VALUE),
MAKEPROP(WPD_DEVICE_SERIAL_NUMBER, DEVICE_SERIAL_NUMBER_VALUE),
MAKEPROP(WPD_DEVICE_SUPPORTS_NON_CONSUMABLE, (BOOL)DEVICE_SUPPORTS_NONCONSUMABLE_VALUE),
MAKEPROP(WPD_DEVICE_MANUFACTURER, DEVICE_MANUFACTURER_VALUE),
MAKEPROP(WPD_DEVICE_FRIENDLY_NAME, DEVICE_FRIENDLY_NAME_VALUE),
MAKEPROP(WPD_DEVICE_TYPE, WPD_DEVICE_TYPE_GENERIC)
));
SetState(SENSOR_STATE_READY);
return hr;
}
void CSensorDevice::OnStateChange(SensorState, SensorState)
{
//
// since this is not a real device we don't notify anyone
//
}
wstring CSensorDevice::GetId() const
{
return WPD_DEVICE_OBJECT_ID;
}
wstring CSensorDevice::GetName() const
{
return WPD_DEVICE_OBJECT_ID;
}
wstring CSensorDevice::GetParentId() const
{
//
// the "DEVICE" object does not have a parent
//
return L"";
}
GUID CSensorDevice::GetFunctionalObjectCategory() const
{
return WPD_FUNCTIONAL_CATEGORY_DEVICE;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.