PDC09 – Pre-Conference – Windows Bootcamp Part 6/6 – Windows Sensors and Location

Sensor Platform Overview

  • Develop better and more productive user experiences
    • Enable environmentally adaptive user interface
  • Windows 7 features a unified API for working with sensors
    • No need to target vendor-specific APIs
    • Consistent interface for sensors, extensions for location
    • Access control and privacy

Sensor Platform Architecture

  • Applications
  • Sensor API
  • Sensor class extensions
  • UMDF Sensor Driver
  • Sensor Device

Sensor class extensions and Sensor API connect to the Location and Other sensors control panel

Privacy and Access Control

  • Sensor data is considered personal
    • User consent is required to share data
  • All sensors are disabled by default
  • Can be preconfigured per user/services
  • Administrator rights required to enabled a sensor

What is a Sensor?

  • Category and Type
    • Category, represents what is being sensed
    • Type, represents how it’s being sensed
  • Properties
    • Read-only (Model, Serial Number) or read-write (Report Interval)
    • Sensors may have custom properties
  • Data
    • Get sensor-specific data report object synchronously or asynchronously (recommended approach)
  • Events
    • State change, leave, data updated, other
  • State
    • Is sensor working properly? What is the problem?

Sensor API Architecture

  • Native/Win32 API
    • COM Based (includes sensorsapi.h and sensors.h)
    • Consist in the following interfaces
      • ISensorManager
      • ISensor
      • ISensorDataReport
  • Windows API CodePack
    • Managed class library to ease .NET Framework access to the Sensor and Location APIs

Location Platform

  • A single API call to answer. Where I am?
    • Enabled location based services
    • Adjust functionality based on location changes
  • Built on top of the sensor API
    • Automatic transition between providers (most accurate providers have priority)
    • Concurrent access for multiple applications
  • Managed Wrapper
  • In .NET 4 we’ll use the System.Devices namespace where this will be placed

No Comments