Beispiel #1
0
        private async void TileManager_TileOpened(object sender, BandTileEventArgs <IBandTileOpenedEvent> e)
        {
            //alert!
            //Create new alert in the alerts list
            ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();

            var eventUniqueID = new DateTime().Millisecond *new Random().Next(1, 5);

            var result = await client.GetDataAsync(59.975349, 10.665395, eventUniqueID);

            await client.CloseAsync();

            //Start sending live data from band to a new event list in sharepoint
        }
Beispiel #2
0
 private void SendLiveData(string type, double value)
 {
     ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();
     client.SendMonitoringDataAsync(eventUniqueID, type, value);
     client.CloseAsync();
 }
Beispiel #3
0
        private async void TileManager_TileOpened(object sender, BandTileEventArgs <IBandTileOpenedEvent> e)
        {
            //alert!
            //Create new alert in the alerts list
            ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();

            var result = await client.CreateAlertAsync(59.975349, 10.665395, eventUniqueID);

            await client.CloseAsync();

            await bandClient.NotificationManager.ShowDialogAsync(e.TileEvent.TileId, "Help is on the way!", "It shouldn't take long...");

            heartRateMonitor();
            //skinTemperatureMonitor();
            //GyroscopeMonitor();
            //PedometerMonitor();
            //GsrMonitor();
            //UVMonitor();

            // start the Heartrate sensor
            try
            {
                await bandClient.SensorManager.HeartRate.StartReadingsAsync();
            }
            catch (BandException ex)
            {
                // handle a Band connection exception
                throw ex;
            }
            //try
            //{
            //    await bandClient.SensorManager.Gyroscope.StartReadingsAsync();
            //}
            //catch (BandException ex)
            //{
            //    // handle a Band connection exception
            //    throw ex;
            //}
            //try
            //{
            //    await bandClient.SensorManager.Pedometer.StartReadingsAsync();
            //}
            //catch (BandException ex)
            //{
            //    // handle a Band connection exception
            //    throw ex;
            //}
            //try
            //{
            //    await bandClient.SensorManager.Gsr.StartReadingsAsync();
            //}
            //catch (BandException ex)
            //{
            //    // handle a Band connection exception
            //    throw ex;
            //}
            //try
            //{
            //    await bandClient.SensorManager.UV.StartReadingsAsync();
            //}
            //catch (BandException ex)
            //{
            //    // handle a Band connection exception
            //    throw ex;
            //}

            //try
            //{
            //    await bandClient.SensorManager.SkinTemperature.StartReadingsAsync();
            //}
            //catch (BandException ex)
            //{
            //    // handle a Band connection exception
            //    throw ex;
            //}
        }