Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion FrameworkSensors/Clients.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ typedef class _SimpleDeviceOrientationDevice : public _ComboDevice
typedef struct _SimpleDeviceOrientationSample
{
FLOAT X;
BOOL Shake;
} SimpleDeviceOrientationSample, *PSimpleDeviceOrientationSample;

SimpleDeviceOrientationSample m_CachedThresholds;
Expand Down
13 changes: 1 addition & 12 deletions FrameworkSensors/SimpleDeviceOrientationClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ typedef enum
{
LINEAR_ACCELEROMETER_DATA_X = 0,
LINEAR_ACCELEROMETER_DATA_TIMESTAMP,
LINEAR_ACCELEROMETER_DATA_SHAKE,
LINEAR_ACCELEROMETER_DATA_COUNT
} LINEAR_ACCELEROMETER_DATA_INDEX;

Expand Down Expand Up @@ -174,7 +173,6 @@ SimpleDeviceOrientationDevice::Initialize(

m_pSupportedDataFields->List[LINEAR_ACCELEROMETER_DATA_TIMESTAMP] = PKEY_SensorData_Timestamp;
m_pSupportedDataFields->List[LINEAR_ACCELEROMETER_DATA_X] = PKEY_SensorData_AccelerationX_Gs;
m_pSupportedDataFields->List[LINEAR_ACCELEROMETER_DATA_SHAKE] = PKEY_SensorData_Shake;
}

//
Expand Down Expand Up @@ -211,14 +209,9 @@ SimpleDeviceOrientationDevice::Initialize(
m_pData->List[LINEAR_ACCELEROMETER_DATA_X].Key = PKEY_SensorData_AccelerationX_Gs;
InitPropVariantFromFloat(0.0, &(m_pData->List[LINEAR_ACCELEROMETER_DATA_X].Value));

m_pData->List[LINEAR_ACCELEROMETER_DATA_SHAKE].Key = PKEY_SensorData_Shake;
InitPropVariantFromBoolean(FALSE, &(m_pData->List[LINEAR_ACCELEROMETER_DATA_SHAKE].Value));

m_CachedData.X = 0.0f;
m_CachedData.Shake = FALSE;

m_LastSample.X = 0.0f;
m_LastSample.Shake = FALSE;
}

//
Expand Down Expand Up @@ -312,7 +305,7 @@ SimpleDeviceOrientationDevice::Initialize(
WDF_OBJECT_ATTRIBUTES MemoryAttributes;
WDFMEMORY MemoryHandle = NULL;

ULONG Size = SENSOR_COLLECTION_LIST_SIZE(LINEAR_ACCELEROMETER_DATA_COUNT - 2); // Timestamp and shake do not have thresholds
ULONG Size = SENSOR_COLLECTION_LIST_SIZE(LINEAR_ACCELEROMETER_DATA_COUNT - 2); // Timestamp does not have thresholds

MemoryHandle = NULL;
WDF_OBJECT_ATTRIBUTES_INIT(&MemoryAttributes);
Expand Down Expand Up @@ -403,13 +396,9 @@ SimpleDeviceOrientationDevice::GetData(
// update last sample
m_LastSample.X = m_CachedData.X;

m_LastSample.Shake = m_CachedData.Shake;

// push to clx
InitPropVariantFromFloat(m_LastSample.X, &(m_pData->List[LINEAR_ACCELEROMETER_DATA_X].Value));

InitPropVariantFromBoolean(m_LastSample.Shake, &(m_pData->List[LINEAR_ACCELEROMETER_DATA_SHAKE].Value));

GetSystemTimePreciseAsFileTime(&TimeStamp);
InitPropVariantFromFileTime(&TimeStamp, &(m_pData->List[LINEAR_ACCELEROMETER_DATA_TIMESTAMP].Value));

Expand Down