Ejemplo n.º 1
0
 /// <summary>
 ///     Device dis connected event
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 public void DeviceDisConnected(object sender, DeviceConnectionEventArgs e)
 {
     IsConnected      = false;
     IsSleeping       = IsLow = IsHigh = IsBatteryLow = false;
     ReadingBlue2Data = false;
     MessagingCenter.Send(new BleConnectionStatusMessage(), HaccpConstant.BleconnectionStatus);
     UnRegisterEvents();
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Devices connected.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        public async void DeviceConnected(object sender, DeviceConnectionEventArgs e)
        {
            SelectedDevice = e.Device;

            IsConnected            = true;
            ReadingBlue2Data       = true;
            GotTemperartureReading = false;
            Settings = new BleSettings();
            SelectedDevice.ServicesDiscovered += ServicesDiscovered;
            SelectedDevice.DiscoverServices();
            MessagingCenter.Send(new BleConnectionStatusMessage(), HaccpConstant.BleconnectionStatus);
            ScanTimeOutElapsed = true;
            await StopScanning();
        }