SlideShare una empresa de Scribd logo
1 de 55
Descargar para leer sin conexión
Utilisation des capteurs dans
les applications Windows 8
       Xavier HALLADE
       Technical Marketing Engineer
       29 Novembre 2012
Legal Disclaimer & Optimization Notice
    INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. EXCEPT AS PROVIDED IN INTEL’S TERMS AND
    CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL IS CLAIMS ANY EXPRESS OR
    IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL PRODUCTS, INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS
    FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHER INTELLECTUAL PROPERTY
    RIGHT. Intel products are not intended for use in medical, life-saving, life sustaining, critical control or safety systems, or in nuclear facility
    applications.
    • Intel products may contain design defects or errors known as errata which may cause the product to deviate from published specifications.
    Current characterized errata are available on request.
    • Intel may make changes to dates, specifications, product descriptions, and plans referenced in this document at any time, without notice.
    • This document may contain information on products in the design phase of development. The information here is subject to change without
    notice. Do not finalize a design with this information.
    • Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves
    these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them.
    • Intel Corporation may have patents or pending patent applications, trademarks, copyrights, or other intellectual property rights that relate
    to the presented subject matter. The furnishing of documents and other materials and information does not provide any license, express or
    implied, by estoppel or otherwise, to any such patents, trademarks, copyrights, or other intellectual property rights.
    • Wireless connectivity and some features may require you to purchase additional software, services or external hardware.
    • Performance tests and ratings are measured using specific computer systems and/or components and reflect the approximate performance
    of Intel products as measured by those tests. Any difference in system hardware or software design or configuration may affect actual
    performance. Buyers should consult other sources of information to evaluate the performance of systems or components they are considering
    purchasing. For more information on performance tests and on the performance of Intel products, visit Intel Performance Benchmark
    Limitations
    • Intel, the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.


                  Optimization Notice
                  Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are
                  not unique to Intel microprocessors. These optimizations include SSE2®, SSE3, and SSSE3 instruction sets and other
                  optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on
                  microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use
                  with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel
                  microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the
                  specific instruction sets covered by this notice.

                                                                                                                        Notice revision #20110804



2
                                                       Copyright© 2012, Intel Corporation. All rights reserved.
                                                 *Other brands and names are the property of their respective owners.
Agenda

    Introduction

    Vue d’ensemble des APIs disponibles

    Windows Runtime
     1. Capteurs de Mouvements/Orientation et Lumière
        Ambiante
     2. Localisation
     3. NFC

    Q/R



3
                             Copyright© 2012, Intel Corporation. All rights reserved.
                       *Other brands and names are the property of their respective owners.
Les différents capteurs disponibles




                                                                                           Lumière
  Compas Acceleromètre Gyroscope                                     GPS                  Ambiante   NFC


 + avec Sensor Fusion: Inclinomètre, Orientation, SimpleOrientation




                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners.
Les APIs disponibles




5
La vieille méthode:
Sensors and Location Platform
    Même interface qu’avec Windows 7
    • Nouveaux capteurs disponibles par de nouvelles GUIDs

    Un “Sensor manager” contrôle les différents capteurs:
    • Donne l’accès aux données
    • Notifie des connexions/déconnexions

    L’accès se fait par interface COM
    • Abonnement aux événements d’objets ILocationEvents /
      ISensorDataReport
    • Référence des APIs :
     – Capteurs: http://msdn.microsoft.com/en-
       us/library/windows/desktop/dd318953(v=vs.85).aspx
     – Localisation: http://msdn.microsoft.com/en-
       us/library/windows/desktop/dd317731(v=vs.85).aspx


6
                            Copyright© 2012, Intel Corporation. All rights reserved.
                      *Other brands and names are the property of their respective owners.
La nouvelle méthode :
L’API Windows Runtime
Windows.Sensors.* -> Capteurs de
Mouvements/Orientation et Lumière Ambiante
 –   Accelerometer
 –   Gyrometer
 –   Inclinometer
 –   OrientationSensor
 –   SimpleOrientationSensor
 –   Compass
 –   LightSensor

Windows.Device.Geolocation -> GPS
Windows.Networking.Proximity.ProximityDevice -> NFC


                          Copyright© 2012, Intel Corporation. All rights reserved.
                    *Other brands and names are the property of their respective owners.
Utiliser l’API Windows Runtime
depuis des applications classiques
Certaines parties de l’API Windows Runtime sont
disponibles depuis les applications de bureau comme
depuis les applications Windows Store :



Vous devez utiliser les fichiers MetaData de l’API :

Platform.winmd
(C:Program Files (x86)Microsoft SDKs Windowsv8.0ExtensionSDKsMicrosoft.VCLibs11
.0ReferencesCommonConfigurationneutral)


Windows.winmd
(C:Program Files (x86)Windows Kits8.0ReferencesCommonConfigurationNeutral)




                               Copyright© 2012, Intel Corporation. All rights reserved.
                         *Other brands and names are the property of their respective owners.
Utiliser l’API Windows Runtime
depuis des applications C#
Déchargez le projet.

Éditez le fichier .csproj pour y ajouter :

<PropertyGroup>
<TargetPlatformVersion>8.0</TargetPlatformVersion>
</PropertyGroup>

Rechargez le projet.

Ajoutez en tant que référence les fichiers Windows.winmd
et Platform.winmd.

Référencez aussi System.Runtime.WindowsRuntime.dll.


                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Utiliser l’API Windows Runtime
depuis des applications C++/CX
C++/CX permet d’utiliser directement l’API WinRT et est
compilé vers du code natif.

Dans les propriétés du projet, dans C/C++->General:

Passez “Consommer l’extension Windows Runtime” à Oui
(/ZW option)

Ajoutez les répertoires de Windows.winmd and
Platform.winmd à “Répertoires #using supplémentaires”

Dans votre code source, ajoutez :

#using <Windows.winmd>
#using <Platform.winmd>


                      Copyright© 2012, Intel Corporation. All rights reserved.
                *Other brands and names are the property of their respective owners.
Utiliser l’API Windows Runtime
depuis des applications C++ standard
avec WRL
#include <Windows.Foundation.h>
#include <wrlwrapperscorewrappers.h>
#include <wrlclient.h>

using namespace ABI::Windows::Foundation;
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;




Plus d’informations : http://msdn.microsoft.com/en-
us/library/hh973459.aspx


                     Copyright© 2012, Intel Corporation. All rights reserved.
               *Other brands and names are the property of their respective owners.
C++/CX ou C++ standard avec WRL
           C++/CX                                                                    C++ avec WRL
                                                    // Initialize the Windows Runtime.
Windows::Foundation::Uri ^uri                  RoInitializeWrapper
= ref new                                  initialize(RO_INIT_MULTITHREADED);
Windows::Foundation::Uri(L"ht
tp://software.intel.com");                     // Get the activation factory for the
                                           IUriRuntimeClass interface.
                                               ComPtr<IUriRuntimeClassFactory> uriFactory;
                                               HRESULT hr =
                                           GetActivationFactory(HStringReference(RuntimeClas
                                           s_Windows_Foundation_Uri).Get(), &uriFactory);

                                               // Create a hstring that represents a URI.
                                               HString uriHString;
                                               hr =
                                           uriHString.Set(L"http://software.intel.com");

                                               // Create the IUriRuntimeClass object.
                                               ComPtr<IUriRuntimeClass> uri;
                                               hr = uriFactory->CreateUri(uriHString.Get(),
                                           &uri);

                                                       (Gestion des erreurs retirée pour que ça rentre…)


                            Copyright© 2012, Intel Corporation. All rights reserved.
                      *Other brands and names are the property of their respective owners.
1. Capteurs de
     mouvements/orientation et
     Lumière Ambiante




13
Orientation et Mouvements

L’accéleromètre retourne l’accélération sur les axes x,
y et z, et peut aussi générer un évenement
« Shake ».

Le gyroscope retourne les vitesses de rotation.

Le magnétomètre retourne la force magnétique sur
x,y,z




                      Copyright© 2012, Intel Corporation. All rights reserved.
                *Other brands and names are the property of their respective owners.
Sensor Fusion




Simple Orientation : retourne 0, 90, 180 ou 270 degrés, face
vers le haut, face retournée

“OrientationSensor” et “Inclinometer” retournent tous les deux
l’orientation complète :
• L’“Inclinometer” retourne les angles de roulis, tanguage et lacet
• L’“Orientation Sensor” retourne un quaternion ainsi qu’une
  matrice de rotation 3x3



                          Copyright© 2012, Intel Corporation. All rights reserved.
                    *Other brands and names are the property of their respective owners.
Orientation et Mouvements


                                                              Même convention qu’avec
                                                              Android et les spécifications
                                                              HTML5




                                                                   0.0° ≤ lacet < 360.0°
                                                                   -180.0° ≤ tangage < 180.0°
                                                                   -90.0° ≤ roulis < 90.0°

                Copyright© 2012, Intel Corporation. All rights reserved.
          *Other brands and names are the property of their respective owners.
Utilisation des capteurs depuis
l’API Windows Runtime
Même méthode pour tout
Windows.Devices.Sensors.*:

• Récupération d’une instance de l’objet en utilisant
  la méthode .GetDefault()

• Configuration de .ReportInterval et ajout d’un
  delegate à l’événement .ReadingChanged

• Ou appel direct à .GetCurrentReading()




                      Copyright© 2012, Intel Corporation. All rights reserved.
                *Other brands and names are the property of their respective owners.
Windows Runtime Sensor API – C#


_accelero = Accelerometer.GetDefault();
if (_accelero != null)
{
         _accelero.ReportInterval = 50 <= _accelero.MinimumReportInterval ?
_accelerometer.MinimumReportInterval : 50;
    //Register for reading changed events
    _accelero.ReadingChanged +=
                   (Accelerometer s, AccelerometerReadingChangedEventArgs args) =>
                                                                                               C
                    {                                                                          #
                       //use args.Reading.AccelerationX/Y/Z
                    };
}




                                                                                               C+
                              Copyright© 2012, Intel Corporation. All rights reserved.
                        *Other brands and names are the property of their respective owners.
                                                                                               +
Windows Runtime Sensor API – C++


 Accelerometer ^accelero = Accelerometer::GetDefault();
 if(accelero!=nullptr)
 {
     accelero->ReportInterval = 50 <= accelero->MinimumReportInterval ?
 accelero->MinimumReportInterval : 50;
     accelero->ReadingChanged += ref new TypedEventHandler<Accelerometer^,
 AccelerometerReadingChangedEventArgs^>(                                                   C
         [](Object^ sender, AccelerometerReadingChangedEventArgs^ args)                    #
         {
           //read args->Reading->AccelerationX/Y/Z
         });
 }




                                                                                           C+
                          Copyright© 2012, Intel Corporation. All rights reserved.
                    *Other brands and names are the property of their respective owners.
                                                                                           +
Demo de l’accéléromètre - C#/WPF

     Une balle sur un canvas

     Les données de l’accéléromètre sont mises à jour
     grâce à l’événement ReadingChanged, un timer sert
     à bouger la balle.




20
                          Copyright© 2012, Intel Corporation. All rights reserved.
                    *Other brands and names are the property of their respective owners.
Demo C#/WPF de l’OrientationSensor




21
                     Copyright© 2012, Intel Corporation. All rights reserved.
               *Other brands and names are the property of their respective owners.
Par rapport à la consommation
     Évitez d’utiliser un ReportInterval trop faible si votre app n’en a
     pas besoin.

     Utilisez les événements plutôt que des appels récurrents.

     Laissez les capteurs tranquilles lorsque l’application n’est pas
     utilisée.

     Si vous n’avez pas besoin de l’orientation complète, utilisez
     directement l’accéléromètre.

                                     Sensors objects: At least one client connected
      Hardware       Accelerometer             Gyroscope                   Inclinometer                Compass   Device Orientation
     Accelerometer        On                            Off                           On                 On             On
             Gyro         Off                           On                            On                 On             On
     Magnetometer         Off                           Off                           On                 On             On




22
                                      Copyright© 2012, Intel Corporation. All rights reserved.
                                *Other brands and names are the property of their respective owners.
Capteur de Lumière Ambiante

Peut être utilisé pour adapter l’interface aux
conditions: contraste, taille de police…

Conditions                    Luminance                                     using Windows.Devices.Sensors;
                              (lux)
Noir complet                                    1                           LightSensors lightSensor =
Intérieur - noir                               10                           LightSensor.GetDefault();
Intérieur – très sombre                        50
Intérieur - sombre                            100                           lightSensor.ReadingChanged +=
Intérieur - normal                            300                           (sender, args) =>
                                                                                   {
Intérieur - lumineux                    1,000                                          //handle
Extérieur - sombre                      5,000                               args.Reading.IlluminanceInLux
Extérieur - nuageux                    30,000                                      };

Extérieur – grand soleil            100,000                                 //lightSensor.GetCurrentReadin
                                                                            g().IlluminanceInLux



                             Copyright© 2012, Intel Corporation. All rights reserved.
                       *Other brands and names are the property of their respective owners.
2. Localisation




24
Location
En fonction du choix de l’utilisateur, son utilisation peut
être interdite. Dans ce cas la permission est
automatiquement demandée au premier lancement.

Pour une application Windows 8* store, il faut déclarer la
capacité “location” dans le fichier manifest.




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Obtenir la position courante – C#



using Windows.Devices.Geolocation;
Geolocator _geo = new Geolocator();

async void getCurrentPosition() {
    if(_geo!= null){
       Geoposition pos = await _geo.GetGeopositionAsync();
       // use pos.Coordinate.(Latitude|Longitude|Accuracy…) and
also pos.CivicAdress if available
    }
}




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Suivre la position et le statut – C#
 using Windows.Devices.Geolocation;
 Geolocator _geo = new Geolocator();

 void trackPosition() {
         if(_geo!= null){
             _geo.DesiredAccuracy = PositionAccuracy::High; //High
 -> will get GPS positioning if available
             _geo.ReportInterval = 1000; //milliseconds
             _geo.PositionChanged += (sender, args) => {
                Geoposition pos = args.Position;
             };
         }
 }
 void trackStatus() {
         if(_geo!= null){
             _geo.StatusChanged += (sender, args) => {
                PositionStatus status = args.Status; //status can
 be Disabled/Initializing/NoData/NotAvailable/NotInitialized/Ready
                };
         }
 }


                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners.
3. NFC




28
Near Field Communication

Portée ultra-courte (<4cm)

Sans Contact

Utilisé entre deux périphériques (actif/actif ou
actif/passif)
• Actif: Smartphone, Tablette, Ultrabook™…
• Passif: Tags, Smart cards…

Petites quantités de données, taux de transfert bas

Facile à utiliser, sensation d’instantannéité (<1/10s)

      -> Bonne expérience utilisateur !



                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Near Field Communication

Appairage
• Avec des périphériques Bluetooth*
• Avec une autre instance de l’application, en établissant
  un socket BT ou Wi-Fi direct (API PeerFinder)

Lecture/Écriture de petites données sur des tags

Échange de données entre périphériques
• Partage d’adresses, contacts, positions
• Transactions sécurisées




                       Copyright© 2012, Intel Corporation. All rights reserved.
                 *Other brands and names are the property of their respective owners.
Vous n’avez pas forcément besoin de vous occuper du
     périphérique NFC…

     UTILISER NFC DE
     MANIÈRE TRANSPARENTE

31
                          Copyright© 2012, Intel Corporation. All rights reserved.
                    *Other brands and names are the property of their respective owners.
Utiliser NFC de manière transparente
        Publier des fichiers et URIs

     Souscrivez à l’événement DataRequested du
     Windows.ApplicationModel.DataTransfer.DataTransferManager




     Le menu “Appuyer et envoyer” apparaitra sur le matériel complet si
     vous mettez une URI ou un StorageItem dans le DataPackage
     demandé.

                  sample: http://code.msdn.microsoft.com/windowsapps/Sharing-Content-
                                                                 Source-App-d9bffd84

32
                              Copyright© 2012, Intel Corporation. All rights reserved.
                        *Other brands and names are the property of their respective owners.
Utiliser NFC de manière transparente
       Recevoir des fichiers et URIs

Enregistrez une application par défaut pour un protocol
(URIs) ou un type de fichiers.



Plus d’informations sur msdn:

• File type and protocol associations model
       (applications Desktop et Windows Store)

• How to handle file activation (applications Windows Store)

• How to handle protocol activation (applications Windows
  Store)

33
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners.
Avec l’API Windows Runtime

     CONTROLER LE
     PÉRIPHÉRIQUE NFC

34
                          Copyright© 2012, Intel Corporation. All rights reserved.
                    *Other brands and names are the property of their respective owners.
Messages NFC
  ProximityDevice.PublishMessage("protocol", data);
  ProximityDevice.SubscribeForMessage("protocol", delegate);

Protocole       Pub Sou Contenu du message
NDEF             X   X Message NDEF
NDEF:ext             X Message NDEF défini par l’application (TNF = 0x04).
NDEF:MIME            X Message NDEF mime (TNF = 0x02). Par exemple,
                        "NDEF:MIME.image/jpeg".
NDEF:URI              X Message NDEF URI (TNF = 0x03). Par exemple,
                        "NDEF:URI.http://contoso.com/sometype".
NDEF:wkt              X Message NDEF prédéfini par le forum NFC (TNF =
                        0x01). Par exemple, "NDEF:wkt.U" pour URI.
NDEF:WriteTag    X      Les données du message à écrire.
NDEF:Unknown          X Message NDEF sans type (TNF = 0x05).




                            Copyright© 2012, Intel Corporation. All rights reserved.
                      *Other brands and names are the property of their respective owners.
Messages NFC
  Windows messages are fully compatible with NDEF
  messages, but they are easier to manipulate:
                      Pu          So
Protocole                            Contenu du message
                      b.          u.
Windows                X          X Données binaires
WindowsUri             X          X Chaîne de caractères UTF-16LE qui est une URI.
                                      utilisez PublishUriMessage pour publier.
WindowsMime              X          X Données du type mime spécifié.
                                      Par exemple, "WindowsMime.image/jpeg".
                                      Si vous recevez un message "WindowsMime"
                                      simple, les 256 premiers bytes sont le type mime
                                      sous forme de string.
Windows:WriteTag     X                Message Windows à écrire sur le tag.
WindowsUri:WriteTag  X                Message WindowsUri à écrire sur le tag.
WindowsMime:WriteTag X                Message WindowsMime à écrire. Exemple:
                                      “WindowsMime:WriteTag.image/jpeg”
LaunchApp:WriteTag       X            Écrit un tag qui peut lancer une app Windows
                                      Store. Plus d’infos sur msdn.
WriteableTag                        X Si un tag inscriptible est à proximité, le message
                                      reçu contiendra la taille inscriptible (int32)

                           Copyright© 2012, Intel Corporation. All rights reserved.
                     *Other brands and names are the property of their respective owners.
Contrôler le périphérique NFC

     Lire les messages URI entrants:

     using Windows.Networking.Proximity; //access NFC device
     using Windows.Security.Cryptography; //help decoding binary messages
         private void startListeningToURIs()
         {
             ProximityDevice proximityDevice = ProximityDevice.GetDefault();
             if (proximityDevice != null){
                  //return value of SubscribeForMessage is a long messageId that
     can be used later to unpublish it
                 proximityDevice.SubscribeForMessage("WindowsUri",
                     new MessageReceivedHandler(
                       (ProximityDevice sender, ProximityMessage message) =>
                       {
                          String uri =
     CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf16LE,
     message.Data).TrimEnd(''); // uri is retrieved and deencoded from message
                       }
                     )
                 );
             }
         }
37
                                 Copyright© 2012, Intel Corporation. All rights reserved.
                           *Other brands and names are the property of their respective owners.
Contrôler le périphérique NFC – C#

     Écrire un message URI sur un tag:
     using Windows.Networking.Proximity; //access NFC device
     using Windows.Security.Cryptography; //help encoding binary messages
     void startWritingURIToTag(String uri)
     {
         ProximityDevice proximityDevice = ProximityDevice.GetDefault();
         if (proximityDevice != null){
              tagWritingMessageId =
     proximityDevice.PublishBinaryMessage("WindowsUri:WriteTag",
                 CryptographicBuffer.ConvertStringToBinary(uri,
     BinaryStringEncoding.Utf16LE),
                     new MessageTransmittedHandler(
                       (ProximityDevice sender, long messageId) =>
                       {
                           //handle messageTransmitted event
                       }
                     )
              );
         }
     }


38
                                Copyright© 2012, Intel Corporation. All rights reserved.
                          *Other brands and names are the property of their respective owners.
Contrôler le périphérique NFC – C#
     Publier une URI:



     Windows.Networking.Proximity.ProximityDevice device =
     Windows.Networking.Proximity.ProximityDevice.GetDefault();

     if(device!=null){
            long messageId = device.PublishUriMessage(new Uri(uri));
     // reuse messageId to unpublish that message
     }




39
                              Copyright© 2012, Intel Corporation. All rights reserved.
                        *Other brands and names are the property of their respective owners.
Demo NFC C#/WPF
     Souscription au message WindowsURI

     Publication d’un message WindowsURI

     Écriture de l’URI sur un tag




40
                           Copyright© 2012, Intel Corporation. All rights reserved.
                     *Other brands and names are the property of their respective owners.
4. Perceptual SDK




41
Intel® Perceptual Computing SDK
  2013 Beta

                                                BETA : évaluation gratuite

                                                Creative* Interactive Gesture Camera:
                                                 Kit développeur disponible à l’achat
                                                            Webcam HD
                                                            Capteur IR de profondeur
                                                            Double microphone


                                                Perceptual Usage Modes Supported:
                                                            Close-range finger and hand tracking
                                                            Face Analysis, Tracking
                                                            Speech Recognition
                                                            2D/3D Object Tracking


                                                APIs:
                                                            High-Level API: For fast, easy programming
                                                            Low-Level API: For innovation and programming
                                                             control



Téléchargement gratuit sur intel.com/software/perceptual

                       Copyright© 2012, Intel Corporation. All rights reserved.
                 *Other brands and names are the property of their respective owners.
Creative* Interactive Gesture Camera




                                                                     Petite, légère

                                                                     basse consommation
     Spécifications:
     • Résolution RGB : 720p                                         intéractions proches
     • Résolution IR : QVGA
       (320x240)
     • Frame Rate: 30fps
     • Taille: 4.27in x 2.03in x 2.11 in
     • Poids: 9.56 oz
     • Alimentation: USB2.0
          Disponible sur intel.com/software/perceptual
43
                                  Copyright© 2012, Intel Corporation. All rights reserved.
                            *Other brands and names are the property of their respective owners.
Reconnaissance de gestes - Demo




44
                     Copyright© 2012, Intel Corporation. All rights reserved.
               *Other brands and names are the property of their respective owners.
Reconnaissance faciale - Demo




45
                     Copyright© 2012, Intel Corporation. All rights reserved.
               *Other brands and names are the property of their respective owners.
Merci !




46
Questions ?




47
Backup




49            Intel Confidential
Accessing the Sensors and Location Platform

     COM INTERFACE


50
                           Copyright© 2012, Intel Corporation. All rights reserved.
                     *Other brands and names are the property of their respective owners.
COM: Connect to sensor manager

     • Access to sensors is through the sensor manager

     • Group policy settings may deny access to the
       system sensors

     // Create the sensor manager
     ISensorManager pSensorManager;

     hr = CoCreateInstance(CLSID_SensorManager, NULL,
     CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pSensorManager));

     if(hr == HRESULT_FROM_WIN32(ERROR_ACCESS_DISABLED_BY_POLICY)){
       // Unable to retrieve sensor manager due to group policy
     settings.
     }
                                                                                              (Source: Microsoft)


51
                             Copyright© 2012, Intel Corporation. All rights reserved.
                       *Other brands and names are the property of their respective owners.
COM: Retrieve a sensor object
     // Get the sensor collection
     hr = pSensorManager->GetSensorsByCategory(SENSOR_CATEGORY_ALL, &pSensorColl);
     if(SUCCEEDED(hr)){
       ULONG ulCount = 0;
       // Verify that the collection contains at least one sensor
       hr = pSensorColl->GetCount(&ulCount);
       if(SUCCEEDED(hr)){
         if(ulCount < 1){
            wprintf_s(L"nNo sensors of the requested category.n");
            hr = E_UNEXPECTED;
         }
               else {
           // Request permissions for all sensors in the collection
           hr = pSensorManager->RequestPermissions(0, pSensorColl, FALSE);
         }
     ...
                    •   Request sensors by category, type or ID

                    •   Request permission to use the sensor(s)
                         •   Windows 8 will open a dialog box to
                             ask the user
                         •   Granting permission triggers the                                       (Source: Microsoft)
                             OnStateChanged event
52
                                   Copyright© 2012, Intel Corporation. All rights reserved.
                             *Other brands and names are the property of their respective owners.
COM: Sensor event callback

 • Receive event
   notifications by
   implementing required                              class CMyEvents : public ISensorEvents
                                                      {
   COM interfaces                                     public:
                                                      STDMETHODIMP QueryInterface(…) {…}
                                                      STDMETHODIMP_(ULONG) AddRef() {…}
                                                      STDMETHODIMP_(ULONG) Release() {…}
 • Sensor events require
                                                         // ISensorEvents methods.
   ISensorEvents                                      STDMETHODIMP OnEvent(…) {…}
                                                      STDMETHODIMP OnDataUpdated(…) {…}
                                                      STDMETHODIMP OnLeave(…) {…}
 • Sensor Manager events                              STDMETHODIMP OnStateChanged(…) {…}
                                                      …
   require
   ISensorManagerEvents

                                                                                       (Source: Microsoft)


53
                      Copyright© 2012, Intel Corporation. All rights reserved.
                *Other brands and names are the property of their respective owners.
COM: Start receiving events

     // Create an instance of the event class
     CMyEvents *pEventClass = new CMyEvents();

     if(SUCCEEDED(hr))
     {
       // Retrieve the pointer to the callback interface
       hr = pEventClass->QueryInterface(IID_PPV_ARGS(&pMyEvents));
     }
     if(SUCCEEDED(hr))
     {
       // Start receiving events
       hr = pSensor->SetEventSink(pMyEvents);
     }




     • To stop receiving events call SetEventSink with a
       parameter of NULL
                                                                                                 (Source: Microsoft)


54
                                Copyright© 2012, Intel Corporation. All rights reserved.
                          *Other brands and names are the property of their respective owners.
Ambient Light Sensor

     DEMO




55
                     Copyright© 2012, Intel Corporation. All rights reserved.
               *Other brands and names are the property of their respective owners.

Más contenido relacionado

Destacado

Leveraging Conductive Inkjet Technology to Build a Scalable and Versatile Sur...
Leveraging Conductive Inkjet Technology to Build a Scalable and Versatile Sur...Leveraging Conductive Inkjet Technology to Build a Scalable and Versatile Sur...
Leveraging Conductive Inkjet Technology to Build a Scalable and Versatile Sur...nwgong
 
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)Werner Keil
 
Payment revolution by Yoav Elgrichi
Payment revolution by Yoav ElgrichiPayment revolution by Yoav Elgrichi
Payment revolution by Yoav ElgrichiSiti Aishah Zahari
 
An Overview of All Ericsson Labs APIs
An Overview of All Ericsson Labs APIsAn Overview of All Ericsson Labs APIs
An Overview of All Ericsson Labs APIsEricsson Labs
 
Wireless sensor networks using android virtual devices and near field
Wireless sensor networks using android virtual devices and near fieldWireless sensor networks using android virtual devices and near field
Wireless sensor networks using android virtual devices and near fieldNicolas Kockel
 
Standards for the Future of Java Embedded (16:9)
Standards for the Future of Java Embedded (16:9)Standards for the Future of Java Embedded (16:9)
Standards for the Future of Java Embedded (16:9)Werner Keil
 
geecon 2013 - Standards for the Future of Java Embedded
geecon 2013 - Standards for the Future of Java Embeddedgeecon 2013 - Standards for the Future of Java Embedded
geecon 2013 - Standards for the Future of Java EmbeddedWerner Keil
 
Track 2 session 3 - st dev con 2016 - simplifying cloud connectivity
Track 2   session 3 - st dev con 2016 - simplifying cloud connectivityTrack 2   session 3 - st dev con 2016 - simplifying cloud connectivity
Track 2 session 3 - st dev con 2016 - simplifying cloud connectivityST_World
 
DevBy. Apple Watch Kit 1.0 (RU) & NFC
DevBy. Apple Watch Kit 1.0 (RU) & NFCDevBy. Apple Watch Kit 1.0 (RU) & NFC
DevBy. Apple Watch Kit 1.0 (RU) & NFCVladimir Hudnitsky
 
The Eclipse M2M IWG and Standards for the Internet of Things
The Eclipse M2M IWG and Standards for the Internet of ThingsThe Eclipse M2M IWG and Standards for the Internet of Things
The Eclipse M2M IWG and Standards for the Internet of ThingsWerner Keil
 
DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...
DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...
DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...Maarten Weyn
 
Latest wireless technology
Latest wireless technologyLatest wireless technology
Latest wireless technologynurmeen1
 
NEAR FIELD COMMUNICATION (NFC)
NEAR FIELD COMMUNICATION (NFC) NEAR FIELD COMMUNICATION (NFC)
NEAR FIELD COMMUNICATION (NFC) ADITYA GUPTA
 
OPTIMOS Interoperability Event - Introduction to the Interoperability Initiative
OPTIMOS Interoperability Event - Introduction to the Interoperability InitiativeOPTIMOS Interoperability Event - Introduction to the Interoperability Initiative
OPTIMOS Interoperability Event - Introduction to the Interoperability InitiativeNFC Forum
 
Transforming the NFC Public Transport Experience from Vision to Reality -- Th...
Transforming the NFC Public Transport Experience from Vision to Reality -- Th...Transforming the NFC Public Transport Experience from Vision to Reality -- Th...
Transforming the NFC Public Transport Experience from Vision to Reality -- Th...NFC Forum
 

Destacado (20)

Leveraging Conductive Inkjet Technology to Build a Scalable and Versatile Sur...
Leveraging Conductive Inkjet Technology to Build a Scalable and Versatile Sur...Leveraging Conductive Inkjet Technology to Build a Scalable and Versatile Sur...
Leveraging Conductive Inkjet Technology to Build a Scalable and Versatile Sur...
 
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
M4M 2 the Rescue of M2M (Eclipse DemoCamp Trondheim)
 
Payment revolution by Yoav Elgrichi
Payment revolution by Yoav ElgrichiPayment revolution by Yoav Elgrichi
Payment revolution by Yoav Elgrichi
 
shirsha
shirshashirsha
shirsha
 
Sto L Pa N@Nfc Academy 2009
Sto L Pa N@Nfc Academy 2009Sto L Pa N@Nfc Academy 2009
Sto L Pa N@Nfc Academy 2009
 
An Overview of All Ericsson Labs APIs
An Overview of All Ericsson Labs APIsAn Overview of All Ericsson Labs APIs
An Overview of All Ericsson Labs APIs
 
Presentation
PresentationPresentation
Presentation
 
Wireless sensor networks using android virtual devices and near field
Wireless sensor networks using android virtual devices and near fieldWireless sensor networks using android virtual devices and near field
Wireless sensor networks using android virtual devices and near field
 
Sensor id overview_ppt
Sensor id overview_pptSensor id overview_ppt
Sensor id overview_ppt
 
Standards for the Future of Java Embedded (16:9)
Standards for the Future of Java Embedded (16:9)Standards for the Future of Java Embedded (16:9)
Standards for the Future of Java Embedded (16:9)
 
geecon 2013 - Standards for the Future of Java Embedded
geecon 2013 - Standards for the Future of Java Embeddedgeecon 2013 - Standards for the Future of Java Embedded
geecon 2013 - Standards for the Future of Java Embedded
 
Track 2 session 3 - st dev con 2016 - simplifying cloud connectivity
Track 2   session 3 - st dev con 2016 - simplifying cloud connectivityTrack 2   session 3 - st dev con 2016 - simplifying cloud connectivity
Track 2 session 3 - st dev con 2016 - simplifying cloud connectivity
 
DevBy. Apple Watch Kit 1.0 (RU) & NFC
DevBy. Apple Watch Kit 1.0 (RU) & NFCDevBy. Apple Watch Kit 1.0 (RU) & NFC
DevBy. Apple Watch Kit 1.0 (RU) & NFC
 
The Eclipse M2M IWG and Standards for the Internet of Things
The Eclipse M2M IWG and Standards for the Internet of ThingsThe Eclipse M2M IWG and Standards for the Internet of Things
The Eclipse M2M IWG and Standards for the Internet of Things
 
DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...
DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...
DASH7 Alliance Protocol 1.0: Low-Power, Mid-Range Sensor and Actuator Communi...
 
Latest wireless technology
Latest wireless technologyLatest wireless technology
Latest wireless technology
 
NEAR FIELD COMMUNICATION (NFC)
NEAR FIELD COMMUNICATION (NFC) NEAR FIELD COMMUNICATION (NFC)
NEAR FIELD COMMUNICATION (NFC)
 
OPTIMOS Interoperability Event - Introduction to the Interoperability Initiative
OPTIMOS Interoperability Event - Introduction to the Interoperability InitiativeOPTIMOS Interoperability Event - Introduction to the Interoperability Initiative
OPTIMOS Interoperability Event - Introduction to the Interoperability Initiative
 
NFC and Android applications
NFC and Android applicationsNFC and Android applications
NFC and Android applications
 
Transforming the NFC Public Transport Experience from Vision to Reality -- Th...
Transforming the NFC Public Transport Experience from Vision to Reality -- Th...Transforming the NFC Public Transport Experience from Vision to Reality -- Th...
Transforming the NFC Public Transport Experience from Vision to Reality -- Th...
 

Similar a Windows 8 Capteur Apps

Intel XDK - Philly JS
Intel XDK - Philly JSIntel XDK - Philly JS
Intel XDK - Philly JSIan Maffett
 
Intel® XDK Разработка мобильных HTML5 приложений. Максим Хухро, Intel
Intel® XDK Разработка мобильных HTML5 приложений. Максим Хухро, Intel Intel® XDK Разработка мобильных HTML5 приложений. Максим Хухро, Intel
Intel® XDK Разработка мобильных HTML5 приложений. Максим Хухро, Intel Apps4All
 
Using JavaScript to Build HTML5 Tools (Ian Maffett)
Using JavaScript to Build HTML5 Tools (Ian Maffett)Using JavaScript to Build HTML5 Tools (Ian Maffett)
Using JavaScript to Build HTML5 Tools (Ian Maffett)Future Insights
 
【視覺進化論】AI智慧視覺運算技術論壇_2_ChungYeh
【視覺進化論】AI智慧視覺運算技術論壇_2_ChungYeh【視覺進化論】AI智慧視覺運算技術論壇_2_ChungYeh
【視覺進化論】AI智慧視覺運算技術論壇_2_ChungYehMAKERPRO.cc
 
Developing Multi-OS Native Mobile Applications with Intel INDE
Developing Multi-OS Native Mobile Applications with Intel INDEDeveloping Multi-OS Native Mobile Applications with Intel INDE
Developing Multi-OS Native Mobile Applications with Intel INDEIntel® Software
 
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP ProgrammingHetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP ProgrammingIntel® Software
 
Build HTML5 VR Apps using Intel® XDK
Build HTML5 VR Apps using Intel® XDKBuild HTML5 VR Apps using Intel® XDK
Build HTML5 VR Apps using Intel® XDKIntel® Software
 
#MBLTdev: Преимущества использования Intel INDE для кросс-ОС разработки на пр...
#MBLTdev: Преимущества использования Intel INDE для кросс-ОС разработки на пр...#MBLTdev: Преимущества использования Intel INDE для кросс-ОС разработки на пр...
#MBLTdev: Преимущества использования Intel INDE для кросс-ОС разработки на пр...e-Legion
 
TDC2017 | São Paulo - Trilha Machine Learning How we figured out we had a SRE...
TDC2017 | São Paulo - Trilha Machine Learning How we figured out we had a SRE...TDC2017 | São Paulo - Trilha Machine Learning How we figured out we had a SRE...
TDC2017 | São Paulo - Trilha Machine Learning How we figured out we had a SRE...tdc-globalcode
 
Tendências da junção entre Big Data Analytics, Machine Learning e Supercomput...
Tendências da junção entre Big Data Analytics, Machine Learning e Supercomput...Tendências da junção entre Big Data Analytics, Machine Learning e Supercomput...
Tendências da junção entre Big Data Analytics, Machine Learning e Supercomput...Igor José F. Freitas
 
Introduction ciot workshop premeetup
Introduction ciot workshop premeetupIntroduction ciot workshop premeetup
Introduction ciot workshop premeetupBeMyApp
 
резников дмитрий
резников дмитрийрезников дмитрий
резников дмитрийapps4allru
 
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013Intel Software Brasil
 
Intel NFVi Enabling Kit Demo/Lab
Intel NFVi Enabling Kit Demo/LabIntel NFVi Enabling Kit Demo/Lab
Intel NFVi Enabling Kit Demo/LabMichelle Holley
 
Software-defined Visualization, High-Fidelity Visualization: OpenSWR and OSPRay
Software-defined Visualization, High-Fidelity Visualization: OpenSWR and OSPRaySoftware-defined Visualization, High-Fidelity Visualization: OpenSWR and OSPRay
Software-defined Visualization, High-Fidelity Visualization: OpenSWR and OSPRayIntel® Software
 
8 intel network builders overview
8 intel network builders overview8 intel network builders overview
8 intel network builders overviewvideos
 

Similar a Windows 8 Capteur Apps (20)

Intel XDK - Philly JS
Intel XDK - Philly JSIntel XDK - Philly JS
Intel XDK - Philly JS
 
MeeGo Overview DeveloperDay Munich
MeeGo Overview DeveloperDay MunichMeeGo Overview DeveloperDay Munich
MeeGo Overview DeveloperDay Munich
 
Android Native Apps Development
Android Native Apps DevelopmentAndroid Native Apps Development
Android Native Apps Development
 
Intel® XDK Разработка мобильных HTML5 приложений. Максим Хухро, Intel
Intel® XDK Разработка мобильных HTML5 приложений. Максим Хухро, Intel Intel® XDK Разработка мобильных HTML5 приложений. Максим Хухро, Intel
Intel® XDK Разработка мобильных HTML5 приложений. Максим Хухро, Intel
 
Using JavaScript to Build HTML5 Tools (Ian Maffett)
Using JavaScript to Build HTML5 Tools (Ian Maffett)Using JavaScript to Build HTML5 Tools (Ian Maffett)
Using JavaScript to Build HTML5 Tools (Ian Maffett)
 
【視覺進化論】AI智慧視覺運算技術論壇_2_ChungYeh
【視覺進化論】AI智慧視覺運算技術論壇_2_ChungYeh【視覺進化論】AI智慧視覺運算技術論壇_2_ChungYeh
【視覺進化論】AI智慧視覺運算技術論壇_2_ChungYeh
 
Developing Multi-OS Native Mobile Applications with Intel INDE
Developing Multi-OS Native Mobile Applications with Intel INDEDeveloping Multi-OS Native Mobile Applications with Intel INDE
Developing Multi-OS Native Mobile Applications with Intel INDE
 
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP ProgrammingHetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
 
Clear Linux OS - Introduction
Clear Linux OS - IntroductionClear Linux OS - Introduction
Clear Linux OS - Introduction
 
Multi-OS Engine Technology Overview
Multi-OS Engine Technology OverviewMulti-OS Engine Technology Overview
Multi-OS Engine Technology Overview
 
Build HTML5 VR Apps using Intel® XDK
Build HTML5 VR Apps using Intel® XDKBuild HTML5 VR Apps using Intel® XDK
Build HTML5 VR Apps using Intel® XDK
 
#MBLTdev: Преимущества использования Intel INDE для кросс-ОС разработки на пр...
#MBLTdev: Преимущества использования Intel INDE для кросс-ОС разработки на пр...#MBLTdev: Преимущества использования Intel INDE для кросс-ОС разработки на пр...
#MBLTdev: Преимущества использования Intel INDE для кросс-ОС разработки на пр...
 
TDC2017 | São Paulo - Trilha Machine Learning How we figured out we had a SRE...
TDC2017 | São Paulo - Trilha Machine Learning How we figured out we had a SRE...TDC2017 | São Paulo - Trilha Machine Learning How we figured out we had a SRE...
TDC2017 | São Paulo - Trilha Machine Learning How we figured out we had a SRE...
 
Tendências da junção entre Big Data Analytics, Machine Learning e Supercomput...
Tendências da junção entre Big Data Analytics, Machine Learning e Supercomput...Tendências da junção entre Big Data Analytics, Machine Learning e Supercomput...
Tendências da junção entre Big Data Analytics, Machine Learning e Supercomput...
 
Introduction ciot workshop premeetup
Introduction ciot workshop premeetupIntroduction ciot workshop premeetup
Introduction ciot workshop premeetup
 
резников дмитрий
резников дмитрийрезников дмитрий
резников дмитрий
 
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
 
Intel NFVi Enabling Kit Demo/Lab
Intel NFVi Enabling Kit Demo/LabIntel NFVi Enabling Kit Demo/Lab
Intel NFVi Enabling Kit Demo/Lab
 
Software-defined Visualization, High-Fidelity Visualization: OpenSWR and OSPRay
Software-defined Visualization, High-Fidelity Visualization: OpenSWR and OSPRaySoftware-defined Visualization, High-Fidelity Visualization: OpenSWR and OSPRay
Software-defined Visualization, High-Fidelity Visualization: OpenSWR and OSPRay
 
8 intel network builders overview
8 intel network builders overview8 intel network builders overview
8 intel network builders overview
 

Más de Intel Developer Zone Community

Intro into Developing Ultrabook Applications - Intel AppLab Berlin
Intro into Developing Ultrabook Applications - Intel AppLab BerlinIntro into Developing Ultrabook Applications - Intel AppLab Berlin
Intro into Developing Ultrabook Applications - Intel AppLab BerlinIntel Developer Zone Community
 
Ultrabook Development Using Touch - Intel Ultrabook AppLab Berlin
Ultrabook Development Using Touch - Intel Ultrabook AppLab BerlinUltrabook Development Using Touch - Intel Ultrabook AppLab Berlin
Ultrabook Development Using Touch - Intel Ultrabook AppLab BerlinIntel Developer Zone Community
 
Ultrabook Development Using Sensors - Intel AppLab Berlin
Ultrabook Development Using Sensors - Intel AppLab BerlinUltrabook Development Using Sensors - Intel AppLab Berlin
Ultrabook Development Using Sensors - Intel AppLab BerlinIntel Developer Zone Community
 
Intel Ultrabook Software Development Tools - Intel AppLab Berlin
Intel Ultrabook Software Development Tools - Intel AppLab BerlinIntel Ultrabook Software Development Tools - Intel AppLab Berlin
Intel Ultrabook Software Development Tools - Intel AppLab BerlinIntel Developer Zone Community
 
MeeGo AppLab Desktop Summit 2011 - Submission and Validation
MeeGo AppLab Desktop Summit 2011 - Submission and ValidationMeeGo AppLab Desktop Summit 2011 - Submission and Validation
MeeGo AppLab Desktop Summit 2011 - Submission and ValidationIntel Developer Zone Community
 

Más de Intel Developer Zone Community (20)

Intel Developer Zone MeetUp Intro
Intel Developer Zone MeetUp IntroIntel Developer Zone MeetUp Intro
Intel Developer Zone MeetUp Intro
 
Perceptual Computing
Perceptual ComputingPerceptual Computing
Perceptual Computing
 
Intel® Developer Zone
Intel® Developer ZoneIntel® Developer Zone
Intel® Developer Zone
 
Gestion du tactile sous windows 8
Gestion du tactile sous windows 8Gestion du tactile sous windows 8
Gestion du tactile sous windows 8
 
Android and Intel Inside
Android and Intel InsideAndroid and Intel Inside
Android and Intel Inside
 
Ultrabook Sensoren Beispiele
Ultrabook Sensoren BeispieleUltrabook Sensoren Beispiele
Ultrabook Sensoren Beispiele
 
Intel Ultrabook AppLab - ALL Slides
Intel Ultrabook AppLab - ALL SlidesIntel Ultrabook AppLab - ALL Slides
Intel Ultrabook AppLab - ALL Slides
 
Intro into Developing Ultrabook Applications - Intel AppLab Berlin
Intro into Developing Ultrabook Applications - Intel AppLab BerlinIntro into Developing Ultrabook Applications - Intel AppLab Berlin
Intro into Developing Ultrabook Applications - Intel AppLab Berlin
 
Ultrabook Development Using Touch - Intel Ultrabook AppLab Berlin
Ultrabook Development Using Touch - Intel Ultrabook AppLab BerlinUltrabook Development Using Touch - Intel Ultrabook AppLab Berlin
Ultrabook Development Using Touch - Intel Ultrabook AppLab Berlin
 
Ultrabook Development Using Sensors - Intel AppLab Berlin
Ultrabook Development Using Sensors - Intel AppLab BerlinUltrabook Development Using Sensors - Intel AppLab Berlin
Ultrabook Development Using Sensors - Intel AppLab Berlin
 
Intel Ultrabook Software Development Tools - Intel AppLab Berlin
Intel Ultrabook Software Development Tools - Intel AppLab BerlinIntel Ultrabook Software Development Tools - Intel AppLab Berlin
Intel Ultrabook Software Development Tools - Intel AppLab Berlin
 
Ultrabook Developer Resources - Intel AppLab Berlin
Ultrabook Developer Resources - Intel AppLab BerlinUltrabook Developer Resources - Intel AppLab Berlin
Ultrabook Developer Resources - Intel AppLab Berlin
 
The New Windows UI - Intel Ultrabook AppLab Berlin
The New Windows UI - Intel Ultrabook AppLab BerlinThe New Windows UI - Intel Ultrabook AppLab Berlin
The New Windows UI - Intel Ultrabook AppLab Berlin
 
Intel AppUp Webinar Italiano General Information
Intel AppUp Webinar Italiano General InformationIntel AppUp Webinar Italiano General Information
Intel AppUp Webinar Italiano General Information
 
Intel AppUp Webinar Italiano html5
Intel AppUp Webinar Italiano html5Intel AppUp Webinar Italiano html5
Intel AppUp Webinar Italiano html5
 
MeeGo AppLab Desktop Summit 2011 - Submission and Validation
MeeGo AppLab Desktop Summit 2011 - Submission and ValidationMeeGo AppLab Desktop Summit 2011 - Submission and Validation
MeeGo AppLab Desktop Summit 2011 - Submission and Validation
 
MeeGo AppLab Desktop Summit 2011 - AppUp
MeeGo AppLab Desktop Summit 2011 - AppUpMeeGo AppLab Desktop Summit 2011 - AppUp
MeeGo AppLab Desktop Summit 2011 - AppUp
 
Intel AppUp™ SDK Suite 1.2 for MeeGo
Intel AppUp™ SDK Suite 1.2 for MeeGoIntel AppUp™ SDK Suite 1.2 for MeeGo
Intel AppUp™ SDK Suite 1.2 for MeeGo
 
Overview Intel AppUp developer program
Overview Intel AppUp developer programOverview Intel AppUp developer program
Overview Intel AppUp developer program
 
Getting Your Windows and MeeGo Apps into AppUp
Getting Your Windows and MeeGo Apps into AppUpGetting Your Windows and MeeGo Apps into AppUp
Getting Your Windows and MeeGo Apps into AppUp
 

Último

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Último (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

Windows 8 Capteur Apps

  • 1. Utilisation des capteurs dans les applications Windows 8 Xavier HALLADE Technical Marketing Engineer 29 Novembre 2012
  • 2. Legal Disclaimer & Optimization Notice INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. EXCEPT AS PROVIDED IN INTEL’S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL IS CLAIMS ANY EXPRESS OR IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL PRODUCTS, INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHER INTELLECTUAL PROPERTY RIGHT. Intel products are not intended for use in medical, life-saving, life sustaining, critical control or safety systems, or in nuclear facility applications. • Intel products may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. • Intel may make changes to dates, specifications, product descriptions, and plans referenced in this document at any time, without notice. • This document may contain information on products in the design phase of development. The information here is subject to change without notice. Do not finalize a design with this information. • Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. • Intel Corporation may have patents or pending patent applications, trademarks, copyrights, or other intellectual property rights that relate to the presented subject matter. The furnishing of documents and other materials and information does not provide any license, express or implied, by estoppel or otherwise, to any such patents, trademarks, copyrights, or other intellectual property rights. • Wireless connectivity and some features may require you to purchase additional software, services or external hardware. • Performance tests and ratings are measured using specific computer systems and/or components and reflect the approximate performance of Intel products as measured by those tests. Any difference in system hardware or software design or configuration may affect actual performance. Buyers should consult other sources of information to evaluate the performance of systems or components they are considering purchasing. For more information on performance tests and on the performance of Intel products, visit Intel Performance Benchmark Limitations • Intel, the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Optimization Notice Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2®, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804 2 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 3. Agenda Introduction Vue d’ensemble des APIs disponibles Windows Runtime 1. Capteurs de Mouvements/Orientation et Lumière Ambiante 2. Localisation 3. NFC Q/R 3 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 4. Les différents capteurs disponibles Lumière Compas Acceleromètre Gyroscope GPS Ambiante NFC + avec Sensor Fusion: Inclinomètre, Orientation, SimpleOrientation Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 6. La vieille méthode: Sensors and Location Platform Même interface qu’avec Windows 7 • Nouveaux capteurs disponibles par de nouvelles GUIDs Un “Sensor manager” contrôle les différents capteurs: • Donne l’accès aux données • Notifie des connexions/déconnexions L’accès se fait par interface COM • Abonnement aux événements d’objets ILocationEvents / ISensorDataReport • Référence des APIs : – Capteurs: http://msdn.microsoft.com/en- us/library/windows/desktop/dd318953(v=vs.85).aspx – Localisation: http://msdn.microsoft.com/en- us/library/windows/desktop/dd317731(v=vs.85).aspx 6 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 7. La nouvelle méthode : L’API Windows Runtime Windows.Sensors.* -> Capteurs de Mouvements/Orientation et Lumière Ambiante – Accelerometer – Gyrometer – Inclinometer – OrientationSensor – SimpleOrientationSensor – Compass – LightSensor Windows.Device.Geolocation -> GPS Windows.Networking.Proximity.ProximityDevice -> NFC Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 8. Utiliser l’API Windows Runtime depuis des applications classiques Certaines parties de l’API Windows Runtime sont disponibles depuis les applications de bureau comme depuis les applications Windows Store : Vous devez utiliser les fichiers MetaData de l’API : Platform.winmd (C:Program Files (x86)Microsoft SDKs Windowsv8.0ExtensionSDKsMicrosoft.VCLibs11 .0ReferencesCommonConfigurationneutral) Windows.winmd (C:Program Files (x86)Windows Kits8.0ReferencesCommonConfigurationNeutral) Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 9. Utiliser l’API Windows Runtime depuis des applications C# Déchargez le projet. Éditez le fichier .csproj pour y ajouter : <PropertyGroup> <TargetPlatformVersion>8.0</TargetPlatformVersion> </PropertyGroup> Rechargez le projet. Ajoutez en tant que référence les fichiers Windows.winmd et Platform.winmd. Référencez aussi System.Runtime.WindowsRuntime.dll. Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 10. Utiliser l’API Windows Runtime depuis des applications C++/CX C++/CX permet d’utiliser directement l’API WinRT et est compilé vers du code natif. Dans les propriétés du projet, dans C/C++->General: Passez “Consommer l’extension Windows Runtime” à Oui (/ZW option) Ajoutez les répertoires de Windows.winmd and Platform.winmd à “Répertoires #using supplémentaires” Dans votre code source, ajoutez : #using <Windows.winmd> #using <Platform.winmd> Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 11. Utiliser l’API Windows Runtime depuis des applications C++ standard avec WRL #include <Windows.Foundation.h> #include <wrlwrapperscorewrappers.h> #include <wrlclient.h> using namespace ABI::Windows::Foundation; using namespace Microsoft::WRL; using namespace Microsoft::WRL::Wrappers; Plus d’informations : http://msdn.microsoft.com/en- us/library/hh973459.aspx Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 12. C++/CX ou C++ standard avec WRL C++/CX C++ avec WRL // Initialize the Windows Runtime. Windows::Foundation::Uri ^uri RoInitializeWrapper = ref new initialize(RO_INIT_MULTITHREADED); Windows::Foundation::Uri(L"ht tp://software.intel.com"); // Get the activation factory for the IUriRuntimeClass interface. ComPtr<IUriRuntimeClassFactory> uriFactory; HRESULT hr = GetActivationFactory(HStringReference(RuntimeClas s_Windows_Foundation_Uri).Get(), &uriFactory); // Create a hstring that represents a URI. HString uriHString; hr = uriHString.Set(L"http://software.intel.com"); // Create the IUriRuntimeClass object. ComPtr<IUriRuntimeClass> uri; hr = uriFactory->CreateUri(uriHString.Get(), &uri); (Gestion des erreurs retirée pour que ça rentre…) Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 13. 1. Capteurs de mouvements/orientation et Lumière Ambiante 13
  • 14. Orientation et Mouvements L’accéleromètre retourne l’accélération sur les axes x, y et z, et peut aussi générer un évenement « Shake ». Le gyroscope retourne les vitesses de rotation. Le magnétomètre retourne la force magnétique sur x,y,z Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 15. Sensor Fusion Simple Orientation : retourne 0, 90, 180 ou 270 degrés, face vers le haut, face retournée “OrientationSensor” et “Inclinometer” retournent tous les deux l’orientation complète : • L’“Inclinometer” retourne les angles de roulis, tanguage et lacet • L’“Orientation Sensor” retourne un quaternion ainsi qu’une matrice de rotation 3x3 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 16. Orientation et Mouvements Même convention qu’avec Android et les spécifications HTML5 0.0° ≤ lacet < 360.0° -180.0° ≤ tangage < 180.0° -90.0° ≤ roulis < 90.0° Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 17. Utilisation des capteurs depuis l’API Windows Runtime Même méthode pour tout Windows.Devices.Sensors.*: • Récupération d’une instance de l’objet en utilisant la méthode .GetDefault() • Configuration de .ReportInterval et ajout d’un delegate à l’événement .ReadingChanged • Ou appel direct à .GetCurrentReading() Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 18. Windows Runtime Sensor API – C# _accelero = Accelerometer.GetDefault(); if (_accelero != null) { _accelero.ReportInterval = 50 <= _accelero.MinimumReportInterval ? _accelerometer.MinimumReportInterval : 50; //Register for reading changed events _accelero.ReadingChanged += (Accelerometer s, AccelerometerReadingChangedEventArgs args) => C { # //use args.Reading.AccelerationX/Y/Z }; } C+ Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners. +
  • 19. Windows Runtime Sensor API – C++ Accelerometer ^accelero = Accelerometer::GetDefault(); if(accelero!=nullptr) { accelero->ReportInterval = 50 <= accelero->MinimumReportInterval ? accelero->MinimumReportInterval : 50; accelero->ReadingChanged += ref new TypedEventHandler<Accelerometer^, AccelerometerReadingChangedEventArgs^>( C [](Object^ sender, AccelerometerReadingChangedEventArgs^ args) # { //read args->Reading->AccelerationX/Y/Z }); } C+ Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners. +
  • 20. Demo de l’accéléromètre - C#/WPF Une balle sur un canvas Les données de l’accéléromètre sont mises à jour grâce à l’événement ReadingChanged, un timer sert à bouger la balle. 20 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 21. Demo C#/WPF de l’OrientationSensor 21 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 22. Par rapport à la consommation Évitez d’utiliser un ReportInterval trop faible si votre app n’en a pas besoin. Utilisez les événements plutôt que des appels récurrents. Laissez les capteurs tranquilles lorsque l’application n’est pas utilisée. Si vous n’avez pas besoin de l’orientation complète, utilisez directement l’accéléromètre. Sensors objects: At least one client connected Hardware Accelerometer Gyroscope Inclinometer Compass Device Orientation Accelerometer On Off On On On Gyro Off On On On On Magnetometer Off Off On On On 22 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 23. Capteur de Lumière Ambiante Peut être utilisé pour adapter l’interface aux conditions: contraste, taille de police… Conditions Luminance using Windows.Devices.Sensors; (lux) Noir complet 1 LightSensors lightSensor = Intérieur - noir 10 LightSensor.GetDefault(); Intérieur – très sombre 50 Intérieur - sombre 100 lightSensor.ReadingChanged += Intérieur - normal 300 (sender, args) => { Intérieur - lumineux 1,000 //handle Extérieur - sombre 5,000 args.Reading.IlluminanceInLux Extérieur - nuageux 30,000 }; Extérieur – grand soleil 100,000 //lightSensor.GetCurrentReadin g().IlluminanceInLux Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 25. Location En fonction du choix de l’utilisateur, son utilisation peut être interdite. Dans ce cas la permission est automatiquement demandée au premier lancement. Pour une application Windows 8* store, il faut déclarer la capacité “location” dans le fichier manifest. Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 26. Obtenir la position courante – C# using Windows.Devices.Geolocation; Geolocator _geo = new Geolocator(); async void getCurrentPosition() { if(_geo!= null){ Geoposition pos = await _geo.GetGeopositionAsync(); // use pos.Coordinate.(Latitude|Longitude|Accuracy…) and also pos.CivicAdress if available } } Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 27. Suivre la position et le statut – C# using Windows.Devices.Geolocation; Geolocator _geo = new Geolocator(); void trackPosition() { if(_geo!= null){ _geo.DesiredAccuracy = PositionAccuracy::High; //High -> will get GPS positioning if available _geo.ReportInterval = 1000; //milliseconds _geo.PositionChanged += (sender, args) => { Geoposition pos = args.Position; }; } } void trackStatus() { if(_geo!= null){ _geo.StatusChanged += (sender, args) => { PositionStatus status = args.Status; //status can be Disabled/Initializing/NoData/NotAvailable/NotInitialized/Ready }; } } Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 29. Near Field Communication Portée ultra-courte (<4cm) Sans Contact Utilisé entre deux périphériques (actif/actif ou actif/passif) • Actif: Smartphone, Tablette, Ultrabook™… • Passif: Tags, Smart cards… Petites quantités de données, taux de transfert bas Facile à utiliser, sensation d’instantannéité (<1/10s) -> Bonne expérience utilisateur ! Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 30. Near Field Communication Appairage • Avec des périphériques Bluetooth* • Avec une autre instance de l’application, en établissant un socket BT ou Wi-Fi direct (API PeerFinder) Lecture/Écriture de petites données sur des tags Échange de données entre périphériques • Partage d’adresses, contacts, positions • Transactions sécurisées Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 31. Vous n’avez pas forcément besoin de vous occuper du périphérique NFC… UTILISER NFC DE MANIÈRE TRANSPARENTE 31 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 32. Utiliser NFC de manière transparente Publier des fichiers et URIs Souscrivez à l’événement DataRequested du Windows.ApplicationModel.DataTransfer.DataTransferManager Le menu “Appuyer et envoyer” apparaitra sur le matériel complet si vous mettez une URI ou un StorageItem dans le DataPackage demandé. sample: http://code.msdn.microsoft.com/windowsapps/Sharing-Content- Source-App-d9bffd84 32 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 33. Utiliser NFC de manière transparente Recevoir des fichiers et URIs Enregistrez une application par défaut pour un protocol (URIs) ou un type de fichiers. Plus d’informations sur msdn: • File type and protocol associations model (applications Desktop et Windows Store) • How to handle file activation (applications Windows Store) • How to handle protocol activation (applications Windows Store) 33 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 34. Avec l’API Windows Runtime CONTROLER LE PÉRIPHÉRIQUE NFC 34 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 35. Messages NFC ProximityDevice.PublishMessage("protocol", data); ProximityDevice.SubscribeForMessage("protocol", delegate); Protocole Pub Sou Contenu du message NDEF X X Message NDEF NDEF:ext X Message NDEF défini par l’application (TNF = 0x04). NDEF:MIME X Message NDEF mime (TNF = 0x02). Par exemple, "NDEF:MIME.image/jpeg". NDEF:URI X Message NDEF URI (TNF = 0x03). Par exemple, "NDEF:URI.http://contoso.com/sometype". NDEF:wkt X Message NDEF prédéfini par le forum NFC (TNF = 0x01). Par exemple, "NDEF:wkt.U" pour URI. NDEF:WriteTag X Les données du message à écrire. NDEF:Unknown X Message NDEF sans type (TNF = 0x05). Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 36. Messages NFC Windows messages are fully compatible with NDEF messages, but they are easier to manipulate: Pu So Protocole Contenu du message b. u. Windows X X Données binaires WindowsUri X X Chaîne de caractères UTF-16LE qui est une URI. utilisez PublishUriMessage pour publier. WindowsMime X X Données du type mime spécifié. Par exemple, "WindowsMime.image/jpeg". Si vous recevez un message "WindowsMime" simple, les 256 premiers bytes sont le type mime sous forme de string. Windows:WriteTag X Message Windows à écrire sur le tag. WindowsUri:WriteTag X Message WindowsUri à écrire sur le tag. WindowsMime:WriteTag X Message WindowsMime à écrire. Exemple: “WindowsMime:WriteTag.image/jpeg” LaunchApp:WriteTag X Écrit un tag qui peut lancer une app Windows Store. Plus d’infos sur msdn. WriteableTag X Si un tag inscriptible est à proximité, le message reçu contiendra la taille inscriptible (int32) Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 37. Contrôler le périphérique NFC Lire les messages URI entrants: using Windows.Networking.Proximity; //access NFC device using Windows.Security.Cryptography; //help decoding binary messages private void startListeningToURIs() { ProximityDevice proximityDevice = ProximityDevice.GetDefault(); if (proximityDevice != null){ //return value of SubscribeForMessage is a long messageId that can be used later to unpublish it proximityDevice.SubscribeForMessage("WindowsUri", new MessageReceivedHandler( (ProximityDevice sender, ProximityMessage message) => { String uri = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf16LE, message.Data).TrimEnd(''); // uri is retrieved and deencoded from message } ) ); } } 37 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 38. Contrôler le périphérique NFC – C# Écrire un message URI sur un tag: using Windows.Networking.Proximity; //access NFC device using Windows.Security.Cryptography; //help encoding binary messages void startWritingURIToTag(String uri) { ProximityDevice proximityDevice = ProximityDevice.GetDefault(); if (proximityDevice != null){ tagWritingMessageId = proximityDevice.PublishBinaryMessage("WindowsUri:WriteTag", CryptographicBuffer.ConvertStringToBinary(uri, BinaryStringEncoding.Utf16LE), new MessageTransmittedHandler( (ProximityDevice sender, long messageId) => { //handle messageTransmitted event } ) ); } } 38 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 39. Contrôler le périphérique NFC – C# Publier une URI: Windows.Networking.Proximity.ProximityDevice device = Windows.Networking.Proximity.ProximityDevice.GetDefault(); if(device!=null){ long messageId = device.PublishUriMessage(new Uri(uri)); // reuse messageId to unpublish that message } 39 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 40. Demo NFC C#/WPF Souscription au message WindowsURI Publication d’un message WindowsURI Écriture de l’URI sur un tag 40 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 42. Intel® Perceptual Computing SDK 2013 Beta  BETA : évaluation gratuite  Creative* Interactive Gesture Camera: Kit développeur disponible à l’achat  Webcam HD  Capteur IR de profondeur  Double microphone  Perceptual Usage Modes Supported:  Close-range finger and hand tracking  Face Analysis, Tracking  Speech Recognition  2D/3D Object Tracking  APIs:  High-Level API: For fast, easy programming  Low-Level API: For innovation and programming control Téléchargement gratuit sur intel.com/software/perceptual Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 43. Creative* Interactive Gesture Camera  Petite, légère  basse consommation Spécifications: • Résolution RGB : 720p  intéractions proches • Résolution IR : QVGA (320x240) • Frame Rate: 30fps • Taille: 4.27in x 2.03in x 2.11 in • Poids: 9.56 oz • Alimentation: USB2.0 Disponible sur intel.com/software/perceptual 43 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 44. Reconnaissance de gestes - Demo 44 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 45. Reconnaissance faciale - Demo 45 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 48.
  • 49. Backup 49 Intel Confidential
  • 50. Accessing the Sensors and Location Platform COM INTERFACE 50 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 51. COM: Connect to sensor manager • Access to sensors is through the sensor manager • Group policy settings may deny access to the system sensors // Create the sensor manager ISensorManager pSensorManager; hr = CoCreateInstance(CLSID_SensorManager, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pSensorManager)); if(hr == HRESULT_FROM_WIN32(ERROR_ACCESS_DISABLED_BY_POLICY)){ // Unable to retrieve sensor manager due to group policy settings. } (Source: Microsoft) 51 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 52. COM: Retrieve a sensor object // Get the sensor collection hr = pSensorManager->GetSensorsByCategory(SENSOR_CATEGORY_ALL, &pSensorColl); if(SUCCEEDED(hr)){ ULONG ulCount = 0; // Verify that the collection contains at least one sensor hr = pSensorColl->GetCount(&ulCount); if(SUCCEEDED(hr)){ if(ulCount < 1){ wprintf_s(L"nNo sensors of the requested category.n"); hr = E_UNEXPECTED; } else { // Request permissions for all sensors in the collection hr = pSensorManager->RequestPermissions(0, pSensorColl, FALSE); } ... • Request sensors by category, type or ID • Request permission to use the sensor(s) • Windows 8 will open a dialog box to ask the user • Granting permission triggers the (Source: Microsoft) OnStateChanged event 52 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 53. COM: Sensor event callback • Receive event notifications by implementing required class CMyEvents : public ISensorEvents { COM interfaces public: STDMETHODIMP QueryInterface(…) {…} STDMETHODIMP_(ULONG) AddRef() {…} STDMETHODIMP_(ULONG) Release() {…} • Sensor events require // ISensorEvents methods. ISensorEvents STDMETHODIMP OnEvent(…) {…} STDMETHODIMP OnDataUpdated(…) {…} STDMETHODIMP OnLeave(…) {…} • Sensor Manager events STDMETHODIMP OnStateChanged(…) {…} … require ISensorManagerEvents (Source: Microsoft) 53 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 54. COM: Start receiving events // Create an instance of the event class CMyEvents *pEventClass = new CMyEvents(); if(SUCCEEDED(hr)) { // Retrieve the pointer to the callback interface hr = pEventClass->QueryInterface(IID_PPV_ARGS(&pMyEvents)); } if(SUCCEEDED(hr)) { // Start receiving events hr = pSensor->SetEventSink(pMyEvents); } • To stop receiving events call SetEventSink with a parameter of NULL (Source: Microsoft) 54 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 55. Ambient Light Sensor DEMO 55 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.