Windows 7 Sensors: Introducing Windows 7 Sensors and Locations

With Windows 7 Microsoft introduced functionality that allows your computer and applications to adapt to their current environment and change the way they look, feel, or behave. Built into the operating system itself is support for a standard way to integrate sensor and location devices, as well as a standard programming model for applications to take advantage of these devices. Today, we can write programs that use sensors, but a lack of standardization has made programming for sensors an arduous task. After completion, a sensor-based program usually forever depends on a particular type of hardware and interface. Using one or more vertical solutions to enable deployment of a software-based system has limited the integration of sensors with computer hardware, and Windows®-based computers are no exception. However, with Windows 7 that has all changed. This and future blog entries will introduce the new Sensors and Location platform, the installation of the development environment for managed and unmanaged code as well as a number of examples on how to develop sensor and location solutions and their integration into WPF and Silverlight.

What Sensors are Supported?

In general anything that provides information about the environment around itself can be thought of as a sensor. As such sensors can be found in almost all electric and electronic devices on the market today. The following table shows the different types of sensors, their placement and their use.

Sensor Type Sensor Placement Sensor Usage
GPS Built into the computer or connected to the computer Location and orientation
Accelerometer Built into the computer or attached to a person Motion, orientation, and location
Proximity Built into the computer or nearby Presence and spatial awareness
Light Built into the computer, nearby, or remote Ambient light conditions, such as room lighting or outdoor daylight
RFID Built into the computer or attached to a person Identification of physical items, automatic logon, or location of people
Compass Attached to a person Orientation
Camera Built into the computer, attached to a person, or remote Recording, object identification, or facial recognition
Microphone Built into the computer, attached to a person, or remote Ambient noise
Temperature Built into the computer or remote Indoor or outdoor ambient temperature and cooking temperature
Moisture Remote Detection of water leaks or lawn sprinkler operation
Motion detector Built into the computer or remote Security systems or sensing of motion near the computer
Traffic Remote, usually public Travel time predictions
Weather station Remote, possibly public Weather conditions and predictions
GPS Built into the computer or connected to the computer Location and orientation
Accelerometer Built into the computer or attached to a person Motion, orientation, and location
Proximity Built into the computer or nearby Presence and spatial awareness
Light Built into the computer, nearby, or remote Ambient light conditions, such as room lighting or outdoor daylight
RFID Built into the computer or attached to a person Identification of physical items, automatic logon, or location of people
Compass Attached to a person Orientation
Camera Built into the computer, attached to a person, or remote Recording, object identification, or facial recognition
Microphone Built into the computer, attached to a person, or remote Ambient noise
Temperature Built into the computer or remote Indoor or outdoor ambient temperature and cooking temperature
Moisture Remote Detection of water leaks or lawn sprinkler operation
Motion detector Built into the computer or remote Security systems or sensing of motion near the computer
Traffic Remote, usually public Travel time predictions
Weather station Remote, possibly public Weather conditions and predictions

   
 

Privacy and Security

It soon becomes obvious that sensors are in their simplest form only data suppliers and manipulators. However, as these sensors become available in the system they become available for other applications also to make use of. This can be problematic. Consider an application that has access to your whereabouts, this application can then provide suggestions as to where you can eat or save money – this can easily lead to unscrupulous persons using these details to spam or harass. The Windows Sensor and Location platform helps to ensure that sensor data remains private, when appropriate, in the following ways.

  • Sensors are off by default. The platform design presumes that any sensor can provide personal data, so each sensor is disabled until the user provides explicit consent to access the sensor data through the Location and Other Sensors Control Panel.
  • Windows provides disclosure messages to the user. These messages help users to understand how using sensors can affect the privacy of personal data.
  • Providing permission for a sensor requires administrator rights.
  • When enabled, a sensor device works for all programs that are running under a particular user account (or for all user accounts), including non-interactive users and services, such as ASPNET or SYSTEM. Because the sensor and location platform cannot ensure that data that is exposed to one process is secure from access by another process, users must give permission for all programs to access a particular sensor device (for a particular user account or all accounts on the computer).
  • Programs that use sensors can call a method to open a system dialog box that prompts users to enable required sensor devices. This feature makes it easy for developers and users to ensure that sensors work when programs need them, while maintaining user control of disclosure of sensor data.
  • Sensor drivers use a special object that processes all I/O requests and ensures that only programs that have user permission can access sensor data.

About the Platform

In Windows 7, the new Sensor and Location Platform API is COM based, meaning that the API is available to both native and managed code applications. The Windows Sensor and Location platform consists of the following developer and user components:

  • The Device Driver Interface (DDI) enables Windows to provide a standard way for sensor devices to connect to the computer and to provide data to other subsystems.
  • The Windows Sensor API provides a set of methods, properties, and events to work with connected sensors and sensor data.
  • The Windows Location API, which is built on the Windows Sensor API, provides a set of programming objects, including scripting objects, for working with location information.
  • The Location and Other Sensors Control Panel enables computer administrators to set sensors, including location sensors, for each user.

Sensor Architecture

The following diagram (from Microsoft) describes the interaction of the above components:

Sensor API

The Sensor API enables C++ developers to create sensor-based programs by using a set of COM interfaces. This API defines interfaces to perform common sensor programming tasks that include managing sensors by category, type, or ID, managing sensor events, working with individual sensors and sensor collections, and working with sensor data. Guidance for developers on how to use sensors in Windows programs is available via header files, documentation, samples, and tools in the Windows SDK.

Location API

The Location API is built on top of the Sensor API and simplifies the interfacing to location sensors and provides an easy way to retrieve data about geographic location while protecting user privacy. As with the Sensor API the Location API is also a set of COM interfaces. Guidance for developers on how to use the Location API in Windows programs is available via header files, documentation, samples, and tools in the Windows SDK.

User Control Panel

The User Control Panel allows the administrator to enable/disable access to sensors system-wide or for each users as well as setting access rights. This ability is required due to some sensors being able to expose sensitive user information such as physical location. Users can also view sensor properties and change the sensor description that is displayed in the user interface.

Sensor App

A Sensor App is a user developed application that supports location based features drawn from the Sensor API. This may be a native or managed application, with managed applications interfacing via inter-op to the API.

Location App

A Location App is a user developed application that supports location based features drawn from the Location API. This may be a native or managed application, with managed applications interfacing via inter-op to the API.

Device Driver Interface

Sensor manufacturers can create device drivers to connect sensors with Windows 7. Sensor device drivers are implemented by using the Windows Portable Devices (WPD) driver model, which is based on the Windows User Mode Driver Framework (UMDF).

Conclusion

Windows 7 now provides an exciting new interface allowing developers to program and integrate sensors into their applications. The Windows 7 SDK provides all the support necessary to get developers up and running quickly and efficiently. The Sensor and Location APIs provide native and managed functionality allowing access common sensor programming tasks that include managing sensors, managing sensor events, and working with sensor data. Moreover, the Windows 7 sensor and Location platform aims to provide a common program model and driver interface for all sensor (including location) devices.

Advertisements

~ by Intelligence4 on December 5, 2010.

 
%d bloggers like this: