sensor and location platform: windows logo testing for drivers jason scott software development...

22

Upload: abel-willis

Post on 17-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com
Page 2: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

Sensor and Location Platform:Windows Logo Testing for Drivers

Jason ScottSoftware Development Engineer in TestPC|[email protected]

Page 3: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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

Page 4: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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

Page 5: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

Sensor and Location Platform

Sensor API

Location API

Sensor Hardware

Application

Application

Application

CPL - Location

and Other

SensorsUMDF Sensor Driver

Sensor Class Extension

Page 6: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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

Page 7: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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

Page 8: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

Platform Driver Support

A high-level view of the sensor driver stack

UMDF Driver

ISensorClassExtensionPlatform-implemented

interface

ISensorDriverDriver-implemented

interface

Page 9: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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

Page 10: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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

Page 11: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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()

Page 12: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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()

Page 13: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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()

Page 14: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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()

Page 15: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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

Page 16: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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

Page 17: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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()

Page 18: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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()

Page 19: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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

Page 20: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

Demo!

• Standalone test

• Required inputs:• Device Instance ID• Test

• Yellow items are warnings

• Red items are errors = failure

Page 21: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

Questions?

Page 22: Sensor and Location Platform: Windows Logo Testing for Drivers Jason Scott Software Development Engineer in Test PC|3 jascott@microsoft.com

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