Introduction to the Windows Sensor and Location Platform
This section summarizes the Windows Sensor and Location platform, discusses the various parts of the platform, and describes how the pieces work together to provide a comprehensive system for working with sensors.
The Windows 7 operating system provides built-in support for sensor devices. This support includes location sensors such as GPS devices. As part of this support, a new development platform provides a standard way for device manufacturers to expose sensor devices to software developers and consumers. The platform gives developers a standardized API and device driver interface (DDI) for working with sensors and sensor data.
Sensors come in many configurations and, from a certain perspective, almost anything that provides data about physical phenomena can be called a sensor. Although we typically think of sensors as hardware devices, logical sensors can also provide information through emulation of sensor functionality in software or firmware. Also, a single hardware device can contain multiple sensors.
The sensor and location platform organizes sensors into categories, which represent broad classes of sensor devices, and types, which represent specific kinds of sensors. For example, a sensor in a video game controller that detects the position and movement of a player's hand (perhaps for a video bowling game) would be categorized as an Orientation sensor, but its type would be 3-D Accelerometer. In code, Windows represents categories and types by using globally unique identifiers (GUIDs), many of which are predefined. Device manufacturers can create new categories and types by defining and publishing new GUIDs when required.
Location devices make up one especially interesting category. By now, most people are familiar with global positioning systems (GPS). In Windows, a GPS is a sensor in the Location category. The Location category also includes other sensor types. Some of these sensor types are software based, such as an IP resolver that provides location information based on an Internet address, a mobile phone tower triangulator that determines location based on nearby towers, or static providers, such as a Wi-Fi network location provider that reads location information from the connected wireless network hub.
The Windows Sensor and Location platform consists of the following developer and user components:
- The 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. These objects include scripting objects for working with location information.
- The Location and Other Sensors Control Panel lets computer administrators enable sensors, including location sensors, for individual users.
The following sections describe each of these components.
Sensor manufacturers can create device drivers to connect sensors to 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). Many device drivers have been written by using these frameworks. Because these technologies are established, experienced device-driver programmers will find writing a sensor driver to be a familiar task. The sensor DDI uses specific UMDF and WPD data types and interfaces, and also defines sensor-specific WPD commands and parameters, where it is required. For more information about creating sensor device drivers, see the Windows Driver Kit.
The Sensor API enables C++ developers to create sensor-based programs by using a set of COM interfaces. The 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. The Windows SDK includes header files, documentation, samples, and tools to help show software developers how to use sensors in Windows programs.
Built on the Sensor API, the Location API provides an easy way to retrieve data about geographic location while protecting user privacy. The Location API provides its functionality through a set of COM interfaces. These interfaces can be used in scripting languages, such as JScript, or by COM programmers through the C++ programming language. Scripting support gives easy access to location data for projects that run in the Local Computer zone, such as gadgets. The Microsoft Windows Software Development Kit (SDK) for Windows 7 and .NET Framework 4.0 includes header files, documentation (including scripting reference documentation), samples, and tools to help show Web and software developers how to use location information in their programs.
Windows 7 includes a control panel that lets computer administrators enable or disable sensors system-wide or for each user. Because some sensors can expose sensitive data, this user interface gives administrators control over whether programs have access to each sensor for each user. Users can also view sensor properties and change the sensor description that appears in the user interface.
Build date: 10/27/2012