Date post: | 17-Jan-2016 |
Category: |
Documents |
Upload: | abel-willis |
View: | 218 times |
Download: | 0 times |
Sensor and Location Platform:Windows Logo Testing for Drivers
Jason ScottSoftware Development Engineer in TestPC|[email protected]
Presentation Goals
• Introduce the Sensor and Location Platform, a new platform for Windows 7
• Define Windows Logo Program requirements
• Equip you with the knowledge to troubleshoot Logo test failures
Overview of the Sensor and Location Platform
• Sensors:• Measure phenomena, such as physical environments, actions, or
states • Examples: GPS device, accelerometer, ambient light sensor
• The Sensor and Location Platform contains two new APIs: • Sensor API• Location API
Sensor and Location Platform
Sensor API
Location API
Sensor Hardware
Application
Application
Application
CPL - Location
and Other
SensorsUMDF Sensor Driver
Sensor Class Extension
The Sensor API
• Offers a standard mechanism for discovering, connecting, and accessing sensor class devices
• Provides an opt-in model for sensor permissions
• Sensors are provided with a mechanism for eventing
• All sensor devices are represented the same
The Location API
• Built on the Sensor platform
• Hides complexity of device and location source management from applications
• Provides customized reports specific to each location device• Latitude and Longitude Report (ILatLongReport)• Civic Address Report (ICivicAddressReport)
• Provides script support
Platform Driver Support
A high-level view of the sensor driver stack
UMDF Driver
ISensorClassExtensionPlatform-implemented
interface
ISensorDriverDriver-implemented
interface
Common Sensor Terms
Term Detail
Property Defined as a key/value pair• Key: PROPERTYKEY, • Value: PropVariant
Data field Defined as a key/value pair• Key: PROPERTYKEY, • Value: PropVariant
Category Defined as a Constant ID• Organizes groups of related
sensors
Type Defined as a Constant ID• Sub grouping of sensors in a
category
Sensor and Location Logo Requirements
The logo requirements promote interoperability and ensure
functionality with a sensor.
Common Sensor
Requirements
Location Sensor
Requirements
Ambient Light Sensor
Requirements
Required Properties Are Supported
Property Test
• SENSOR_PROPERTY_TYPE
• SENSOR_PROPERTY_STATE
•
SENSOR_PROPERTY_PERSISTENT_UNIQU
E_ID
• SENSOR_PROPERTY_MANUFACTURER
• SENSOR_PROPERTY_MODEL
• SENSOR_PROPERTY_SERIAL_NUMBER
• SENSOR_PROPERTY_FRIENDLY_NAME
•
SENSOR_PROPERTY_MIN_REPORT_INTERV
AL
• WPD_FUNCTIONAL_OBJECT_CATEGORY
• Each property must exist
• Data types for property values match documented data types• Sensors.h documents data
type
• If the test fails, investigate the output to ISensorDriver interface methods:• OnGetSupportedProperties()• OnGetProperties()
Required Static Properties Don’t Change
Property Test
• SENSOR_PROPERTY_TYPE
•
SENSOR_PROPERTY_PERSISTENT_UNIQUE
_ID
• SENSOR_PROPERTY_MANUFACTURER
• SENSOR_PROPERTY_MODEL
• SENSOR_PROPERTY_SERIAL_NUMBER
• SENSOR_PROPERTY_FRIENDLY_NAME
•
SENSOR_PROPERTY_MIN_REPORT_INTERV
AL
• Each of the properties must exist
• Data types for property values match documented data types
• Property value doesn’t change
• If the test fails, investigate the output to ISensorDriver interface method:• OnGetProperties()
Two Properties Must Be Settable
Property Test
• SENSOR_PROPERTY_CHANGE_SENSITIVITY
•
SENSOR_PROPERTY_CURRENT_REPORT_INTER
VAL
These properties are optional!
• Test runs only if properties exist
• Properties will be written to and read from
• Data types for values match documented property data types
• If the test fails, investigate the output to ISensorDriver interface methods:• OnGetProperties()• OnSetProperties()
Sensor Reports Data
Requirement Test details
Sensor drivers are expected to report data to be functional in the platform.
Sensor reports at least one data field in addition to:
• SENSOR_DATA_TYPE_TIMESTAMP
• SENSOR_DATA_TYPE_TIMESTAMP must exist
• At least one additional data field must exist
• If the test fails, investigate the output to ISensorDriver interface methods:• OnGetSupportedDataFields()
Sensor Reports Missing Properties
Requirement Test
• Driver response to missing property request contains expected information:• HRESULT• Output value
• Requirement helps ensure API can manage common error scenario
• HRESULT is S_FALSE• Output PropVariant:
• Type is VT_ERROR• Value is
HRESULT_FROM_WIN32(ERROR_NOT_ FOUND)
• On failure, investigate responses to:• ISensorDriver::OnGetProperties()• ISensorDriver::OnSetProperties() • Check for permissions errors
Location Reports from the Location API
• Location reports are a packaged set of sensor data fields:
Sensor
Data Field
Sensor
Data Field
Location Report
• Devices in Category SENSOR_CATEGORY_LOCATION must support one or both location reports:• ILatLongReport and / or ICivicAddressReport
Data Field Support for Location ReportsRequirement Test
Data fields support at least one Location report:
ILatLongReport:•SENSOR_DATA_TYPE_TIMESTAMP•SENSOR_DATA_TYPE_LATITUDE_DEGREES•SENSOR_DATA_TYPE_LONGITUDE_DEGREES•SENSOR_DATA_TYPE_ERROR_RADIUS
ICivicAddressReport:• SENSOR_DATA_TYPE_COUNTRY_REGION• SENSOR_DATA_TYPE_TIMESTAMP and/or• SENSOR_DATA_TYPE_POSTALCODE• SENSOR_DATA_TYPE_TIMESTAMP
• Category is SENSOR_CATEGORY_LOCATION
• Data fields for at least one report are present• ILatLongReport• ICivicAddressReport
• On failure, investigate responses to:• ISensorDriver::OnGetSupportedDataFi
elds()
Data Field Support for Ambient Light Sensors
• Requirement specific to Ambient Light Sensor
• Sensor must report data field: SENSOR_DATA_TYPE_LIGHT_LEVEL_LUX
Requirement Test
• Requirement applies to ambient light sensors:
• Sensor must report data field:SENSOR_DATA_TYPE_LIGHT_LEVEL_LUX
• Requirement helps ensure minimum functionality for light sensors
• Sensor type must be: SENSOR_TYPE_AMBIENT_LIGHT
• Sensor must expose the data field:
SENSOR_DATA_TYPE_LIGHT_LEVEL_LUX
• If the test fails, investigate the output to ISensorDriver interface method:• OnGetSupportedDataFields()
Testing Sensor and Location Logo Requirements
At least one test per requirement
Tested in COM via C++
Tests use Sensors API
An overview of the requirement testing methodology
Demo!
• Standalone test
• Required inputs:• Device Instance ID• Test
• Yellow items are warnings
• Red items are errors = failure
Questions?
Links and Resources
• Contact Us:• [email protected]• [email protected]
• Sensors.h in SDK and WDK • Documentation on MSDN
• PROPERTYKEY Structurehttp://msdn.microsoft.com/en-us/library/bb773381.aspx
• PROPVARIANT Structurehttp://msdn.microsoft.com/en-us/library/aa380072.aspx
• IPortableDeviceValues Interfacehttp://msdn.microsoft.com/en-us/library/ms740012(VS.85).aspx