public override async Task Prepare()
 {
     BandClient = await BandClientManager.Instance.ConnectAsync(BandInfo);
     _sensorManager = BandClient.SensorManager;
     await _sensorManager.HeartRate.RequestUserConsent();
     _sensorManager.HeartRate.ReadingChanged += async (sender, args) =>
     {
         await _eventHubSasClient.SendMessageAsync(JsonConvert.SerializeObject(args.SensorReading));
     };
 }
Ejemplo n.º 2
0
        internal BandContactSensor(BandSensorManager manager)
        {
            this.manager = manager;
#if __ANDROID__ || __IOS__
            this.Native = manager.Native.CreateContactSensor();
#elif WINDOWS_PHONE_APP
            this.Native = manager.Native.Contact;
#endif

            Native.ReadingChanged += OnReadingChanged;
        }
        internal BandUltravioletLightSensor(BandSensorManager manager)
        {
            this.manager = manager;
#if __ANDROID__ || __IOS__
            this.Native = manager.Native.CreateUVSensor();
#elif WINDOWS_PHONE_APP
            this.Native = manager.Native.Ultraviolet;
#endif

            Native.ReadingChanged += OnReadingChanged;
        }
Ejemplo n.º 4
0
        internal BandSkinTemperatureSensor(BandSensorManager manager)
        {
            this.manager = manager;
#if __ANDROID__ || __IOS__
            this.Native = manager.Native.CreateSkinTemperatureSensor();
#elif WINDOWS_PHONE_APP
            this.Native = manager.Native.SkinTemperature;
#endif

            Native.ReadingChanged += OnReadingChanged;
        }
Ejemplo n.º 5
0
        public override async void OnAppearing(object navigationContext)
        {
            // Init
            BandClient = navigationContext as BandClient;
            _sensorManager = BandClient.SensorManager;

            // Get Distance Data
            await _sensorManager.Distance.StartReadingsAsync(BandSensorSampleRate.Ms128);
            _sensorManager.Distance.ReadingChanged += (s, e) =>
            {
                TotalDistance = e.SensorReading.TotalDistance;
                var speed = e.SensorReading.Speed;
                var pace = e.SensorReading.Pace;
                var currentmotion = e.SensorReading.CurrentMotion;
            };

            base.OnAppearing(navigationContext);
        }