SlideShare a Scribd company logo
1 of 30
Windows 7 Deep Dive LabSensor & Location Platform Dennis Loktionov dloktionov@absolute.com July 16, 2009
Agenda Windows 7 Sensor & Location Platform ,[object Object]
Sensor Platform Architecture
Working with the Sensor API
Location Platform Architecture
Working with the Location API
DemosQuestions
Introduction Definition Sensors measure a physical phenomenon or a physical interaction Sensor Types Ambient Light Sensors (ALS) Accelerometers Location Sensors GPS, Wi-Fi /cell tower triangulation, IP Geolocation Proximity Sensors Temperature Sensors Biometric Sensor* Others (Human presence, RFID)
Limitations of Sensors Today Sensors are integrated as vertical solutions Applications need to know sensor hardware specifics Limited adoption and scope Sensors are exposed as virtual COM ports Exclusive application access Not secure Proprietary data formats (NMEA, others)
Sensor Platform Overview Unified Driver Model for all types of sensors Physical sensors (e.g., GPS devices, Light Sensors) Logical sensor (e.g., Wi-Fi triangulation resolver) Standard APIs for accessing sensors COM-based Sensor API  Works with drivers using the sensor class extension Benefits Implements native support for sensor and location devices on Windows No need to target vendor-specific APIs or to know hardware specifics Consistent interface for all sensor types Privacy and security
Sensor Platform Architecture Application Application Location and Other Sensors Control Panel Sensor API User System Sensor class extension UMDF sensor driver Sensor device This is a partial diagram of the Sensor and Location Platform, showing only sensor-related parts
Privacy and Access Control ,[object Object]
Legal term: Personally identifiable information (PII)
User consent is required to share data
All sensors are disabled by default
Administrator rights required to enable a sensor
Sensors are configured on a per-user basis (not per application)
Enable Sensors dialog box   is invoked by applications
Sensor API Architecture COM-based API (includes Sensorsapi.h and Sensors.h) Consists of these main interfaces: ISensorManager Sensor enumeration, attachment event, request permissions ISensor Get and set properties, get report, events (new report, detachment, state change, custom) and more ISensorDataReport Get sensor data report data fields
Sensor API Architecture
Sensors Explained Enumerated via category and type GUIDs  Category represents what is being sensed (for example,  environment, location, motion, electrical systems) Type represents how it is being sensed (for example, by thermometer, GPS, accelerometer, voltage) Properties Read-only (such as model) or read-write (such as report interval). Sensors may have custom properties Data Get (sensor-specific) data report object synchronously (not recommended) or asynchronously (events) Events State change, leave (detach), data updated, custom State Is sensor working properly? Do you have access?
Enumerating Sensors #include <sensorsapi.h> #include <sensors.h> HRESULT hr; CComPtr<ISensorManager> pSensorManager; pSensorManager.CoCreateInstance(CLSID_SensorManager); CComPtr<ISensorCollection> pALSCollection; CComPtr<ISensor> pALSSensor; // Get all the ALS sensors on the system pSensorManager->GetSensorsByType(SENSOR_TYPE_AMBIENT_LIGHT, &pALSCollection); hr = pSensorManager->RequestPermissions( 		0,                // Owner window  		pALSCollection,   // Collection of sensors requiring permissions 		TRUE);            // Modal flag if(SUCCEEDED(hr)) { 	   pALSCollection->GetAt(0, &pALSSensor); }
Getting Current Light Level STDMETHODIMP CALSEventSink::OnDataUpdated( 		ISensor* pSensor, ISensorDataReport* pNewData) 	{ PROPVARIANT lightLevel;      PropVariantInit(&lightLevel);       // Get the sensor reading from the ISensorDataReport object pNewData->GetSensorValue(SENSOR_DATA_TYPE_LIGHT_LEVEL_LUX, &lightLevel); // Extract the float value from the PROPVARIANT object float luxValue = V_FLOAT(lightLevel); // Normalize the light sensor data double lightNormalized = ::pow(luxValue, 0.4) / 100.0; // Handle UI changes based on the normalized LUX data      // which ranges from 0.0 - 1.0 for a lux range of // 0 lux to 100,000 lux, this method represents such a      // handler that would be implemented in your application      UpdateUI(lightNormalized);       PropVariantClear(&lightLevel); return S_OK; 	}
Sensor .NET Wrapper Architecture
Sensor .NET Wrapper Architecture ,[object Object]
Derived types can add properties and events,[object Object]
Provides a strongly-typed way to access data,[object Object]
Sensor Development Kit ,[object Object]

More Related Content

Similar to Windows7 Sensor & Location Platform

Android location and sensors API
Android location and sensors APIAndroid location and sensors API
Android location and sensors APIeleksdev
 
A novel approach to Web of things: M2M and enhanced javascript technologies
A novel approach to Web of things: M2M and  enhanced javascript technologiesA novel approach to Web of things: M2M and  enhanced javascript technologies
A novel approach to Web of things: M2M and enhanced javascript technologiesGiuseppe La Torre
 
2 Win7 For Devs Ux Touch Sensors
2 Win7 For Devs Ux Touch Sensors2 Win7 For Devs Ux Touch Sensors
2 Win7 For Devs Ux Touch Sensorsllangit
 
Sensing Mobile Devices talk from QCon London 2013
Sensing Mobile Devices talk from QCon London 2013Sensing Mobile Devices talk from QCon London 2013
Sensing Mobile Devices talk from QCon London 2013Adam Blum
 
Evaluation of the Technology Supporting the Development of an Assets Tracking...
Evaluation of the Technology Supporting the Development of an Assets Tracking...Evaluation of the Technology Supporting the Development of an Assets Tracking...
Evaluation of the Technology Supporting the Development of an Assets Tracking...Dominique Guinard
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorialSynapseindiappsdevelopment
 
Towards a REST architecture for networked vehicles and sensors
Towards a REST architecture for networked vehicles and sensorsTowards a REST architecture for networked vehicles and sensors
Towards a REST architecture for networked vehicles and sensorsJosé Pinto
 
Android overview
Android overviewAndroid overview
Android overviewHas Taiar
 
Application Development for the Internet of Things.pptx
Application Development for the Internet of Things.pptxApplication Development for the Internet of Things.pptx
Application Development for the Internet of Things.pptxKabileshCm
 
GeoCENS OGC Standards and Sensor Web Enablement presented at GeoCENS Banff Se...
GeoCENS OGC Standards and Sensor Web Enablement presented at GeoCENS Banff Se...GeoCENS OGC Standards and Sensor Web Enablement presented at GeoCENS Banff Se...
GeoCENS OGC Standards and Sensor Web Enablement presented at GeoCENS Banff Se...Cybera Inc.
 
WoT.js - WoT App. Framework for Open Source Hardware
WoT.js - WoT App. Framework for Open Source HardwareWoT.js - WoT App. Framework for Open Source Hardware
WoT.js - WoT App. Framework for Open Source HardwareJonathan Jeon
 
Prototype Implementation of a Demand Driven Network Monitoring Architecture
Prototype Implementation of a Demand Driven Network Monitoring ArchitecturePrototype Implementation of a Demand Driven Network Monitoring Architecture
Prototype Implementation of a Demand Driven Network Monitoring ArchitectureAugusto Ciuffoletti
 
Advanced Open IoT Platform for Prevention and Early Detection of Forest Fires
Advanced Open IoT Platform for Prevention and Early Detection of Forest FiresAdvanced Open IoT Platform for Prevention and Early Detection of Forest Fires
Advanced Open IoT Platform for Prevention and Early Detection of Forest FiresIvo Andreev
 
Application Programming Interface
Application Programming InterfaceApplication Programming Interface
Application Programming InterfaceSeculert
 

Similar to Windows7 Sensor & Location Platform (20)

Contiki wsn
Contiki wsnContiki wsn
Contiki wsn
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Android location and sensors API
Android location and sensors APIAndroid location and sensors API
Android location and sensors API
 
A novel approach to Web of things: M2M and enhanced javascript technologies
A novel approach to Web of things: M2M and  enhanced javascript technologiesA novel approach to Web of things: M2M and  enhanced javascript technologies
A novel approach to Web of things: M2M and enhanced javascript technologies
 
2 Win7 For Devs Ux Touch Sensors
2 Win7 For Devs Ux Touch Sensors2 Win7 For Devs Ux Touch Sensors
2 Win7 For Devs Ux Touch Sensors
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Week12.pdf
Week12.pdfWeek12.pdf
Week12.pdf
 
Sensing Mobile Devices talk from QCon London 2013
Sensing Mobile Devices talk from QCon London 2013Sensing Mobile Devices talk from QCon London 2013
Sensing Mobile Devices talk from QCon London 2013
 
Evaluation of the Technology Supporting the Development of an Assets Tracking...
Evaluation of the Technology Supporting the Development of an Assets Tracking...Evaluation of the Technology Supporting the Development of an Assets Tracking...
Evaluation of the Technology Supporting the Development of an Assets Tracking...
 
Application Hosting
Application HostingApplication Hosting
Application Hosting
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 
Towards a REST architecture for networked vehicles and sensors
Towards a REST architecture for networked vehicles and sensorsTowards a REST architecture for networked vehicles and sensors
Towards a REST architecture for networked vehicles and sensors
 
Android overview
Android overviewAndroid overview
Android overview
 
Application Development for the Internet of Things.pptx
Application Development for the Internet of Things.pptxApplication Development for the Internet of Things.pptx
Application Development for the Internet of Things.pptx
 
GeoCENS OGC Standards and Sensor Web Enablement presented at GeoCENS Banff Se...
GeoCENS OGC Standards and Sensor Web Enablement presented at GeoCENS Banff Se...GeoCENS OGC Standards and Sensor Web Enablement presented at GeoCENS Banff Se...
GeoCENS OGC Standards and Sensor Web Enablement presented at GeoCENS Banff Se...
 
WoT.js - WoT App. Framework for Open Source Hardware
WoT.js - WoT App. Framework for Open Source HardwareWoT.js - WoT App. Framework for Open Source Hardware
WoT.js - WoT App. Framework for Open Source Hardware
 
Prototype Implementation of a Demand Driven Network Monitoring Architecture
Prototype Implementation of a Demand Driven Network Monitoring ArchitecturePrototype Implementation of a Demand Driven Network Monitoring Architecture
Prototype Implementation of a Demand Driven Network Monitoring Architecture
 
Advanced Open IoT Platform for Prevention and Early Detection of Forest Fires
Advanced Open IoT Platform for Prevention and Early Detection of Forest FiresAdvanced Open IoT Platform for Prevention and Early Detection of Forest Fires
Advanced Open IoT Platform for Prevention and Early Detection of Forest Fires
 
Application Programming Interface
Application Programming InterfaceApplication Programming Interface
Application Programming Interface
 

Recently uploaded

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Windows7 Sensor & Location Platform

  • 1. Windows 7 Deep Dive LabSensor & Location Platform Dennis Loktionov dloktionov@absolute.com July 16, 2009
  • 2.
  • 3.
  • 4.
  • 6. Working with the Sensor API
  • 8. Working with the Location API
  • 10. Introduction Definition Sensors measure a physical phenomenon or a physical interaction Sensor Types Ambient Light Sensors (ALS) Accelerometers Location Sensors GPS, Wi-Fi /cell tower triangulation, IP Geolocation Proximity Sensors Temperature Sensors Biometric Sensor* Others (Human presence, RFID)
  • 11. Limitations of Sensors Today Sensors are integrated as vertical solutions Applications need to know sensor hardware specifics Limited adoption and scope Sensors are exposed as virtual COM ports Exclusive application access Not secure Proprietary data formats (NMEA, others)
  • 12. Sensor Platform Overview Unified Driver Model for all types of sensors Physical sensors (e.g., GPS devices, Light Sensors) Logical sensor (e.g., Wi-Fi triangulation resolver) Standard APIs for accessing sensors COM-based Sensor API Works with drivers using the sensor class extension Benefits Implements native support for sensor and location devices on Windows No need to target vendor-specific APIs or to know hardware specifics Consistent interface for all sensor types Privacy and security
  • 13. Sensor Platform Architecture Application Application Location and Other Sensors Control Panel Sensor API User System Sensor class extension UMDF sensor driver Sensor device This is a partial diagram of the Sensor and Location Platform, showing only sensor-related parts
  • 14.
  • 15. Legal term: Personally identifiable information (PII)
  • 16. User consent is required to share data
  • 17. All sensors are disabled by default
  • 18. Administrator rights required to enable a sensor
  • 19. Sensors are configured on a per-user basis (not per application)
  • 20. Enable Sensors dialog box is invoked by applications
  • 21. Sensor API Architecture COM-based API (includes Sensorsapi.h and Sensors.h) Consists of these main interfaces: ISensorManager Sensor enumeration, attachment event, request permissions ISensor Get and set properties, get report, events (new report, detachment, state change, custom) and more ISensorDataReport Get sensor data report data fields
  • 23. Sensors Explained Enumerated via category and type GUIDs Category represents what is being sensed (for example, environment, location, motion, electrical systems) Type represents how it is being sensed (for example, by thermometer, GPS, accelerometer, voltage) Properties Read-only (such as model) or read-write (such as report interval). Sensors may have custom properties Data Get (sensor-specific) data report object synchronously (not recommended) or asynchronously (events) Events State change, leave (detach), data updated, custom State Is sensor working properly? Do you have access?
  • 24. Enumerating Sensors #include <sensorsapi.h> #include <sensors.h> HRESULT hr; CComPtr<ISensorManager> pSensorManager; pSensorManager.CoCreateInstance(CLSID_SensorManager); CComPtr<ISensorCollection> pALSCollection; CComPtr<ISensor> pALSSensor; // Get all the ALS sensors on the system pSensorManager->GetSensorsByType(SENSOR_TYPE_AMBIENT_LIGHT, &pALSCollection); hr = pSensorManager->RequestPermissions( 0, // Owner window pALSCollection, // Collection of sensors requiring permissions TRUE); // Modal flag if(SUCCEEDED(hr)) { pALSCollection->GetAt(0, &pALSSensor); }
  • 25. Getting Current Light Level STDMETHODIMP CALSEventSink::OnDataUpdated( ISensor* pSensor, ISensorDataReport* pNewData) { PROPVARIANT lightLevel; PropVariantInit(&lightLevel); // Get the sensor reading from the ISensorDataReport object pNewData->GetSensorValue(SENSOR_DATA_TYPE_LIGHT_LEVEL_LUX, &lightLevel); // Extract the float value from the PROPVARIANT object float luxValue = V_FLOAT(lightLevel); // Normalize the light sensor data double lightNormalized = ::pow(luxValue, 0.4) / 100.0; // Handle UI changes based on the normalized LUX data // which ranges from 0.0 - 1.0 for a lux range of // 0 lux to 100,000 lux, this method represents such a // handler that would be implemented in your application UpdateUI(lightNormalized); PropVariantClear(&lightLevel); return S_OK; }
  • 26. Sensor .NET Wrapper Architecture
  • 27.
  • 28.
  • 29.
  • 30.
  • 38. Diagnostic and sample applications
  • 42.
  • 43. Location-Awareness Opportunities Useful local information Location based search for points of interest Mapping/navigation based on current location PC recovery service Social networking: Where are my friends and family? Others…
  • 44. Location Platform API Overview The Windows 7 Location API is built on top of the Sensor API COM-based API (includes Locationapi.h) It is a high-level abstraction Leverages sensors which provide location information Some sensors (location providers) may be logical Ex: Wi-Fi hotspot triangulation
  • 45. Location Platform Architecture Gadget or script Application Application Location API Location IDispatch Interface Sensor API User Location and Other Sensors Control Panel System Sensor class extension Sensor class extension UMDF sensor driver UMDF sensor driver Sensor device Logical location sensor (Triangulation)
  • 48. Types of Location Data Geographic data (ILatLongReport) Latitude, longitude, altitude, associated error required Most common format Best format for precise location Can reverse geo-code later Civic address (ICivicAddressReport) Zip code, country required Most human readable Best for ‘rough’ location estimates, street directions Demo…
  • 49. 3D Bing Maps & Location Platform Demo…
  • 50. Summary Sensor Platform overview & architecture Native Sensor API Managed Sensor API wrapper Native Location API Types of location data, default location Managed Location API wrapper
  • 52. The End. Fin. Конец. THANKS