Exemplo n.º 1
0
        private void IBleStack_DiscoveryComplete(IBleStack sender, BleDiscoveryStatus status)
        {
            ExecuteOnMainThread.BeginInvoke(() =>
            {
                string discovery_status = "Discovery status : ";
                switch (status)
                {
                case BleDiscoveryStatus.BDS_COMPLETE:
                    {
                        discovery_status += "Complete!";
                        break;
                    }

                case BleDiscoveryStatus.BDS_CANCELED:
                    {
                        discovery_status += "Canceled!";
                        break;
                    }

                case BleDiscoveryStatus.BDS_FAILED:
                    {
                        discovery_status += "Failed!";
                        break;
                    }

                default:
                    {
                        discovery_status += "Unknown...";
                        break;
                    }
                }
                lbStatus.Text = discovery_status;
            });
        }
Exemplo n.º 2
0
        private void IBleStack_DeviceLost(IBleStack sender, BleDeviceInformation device_info)
        {
            int index = 0;

            foreach (BleDeviceInformation ble_device_info in BleDevices)
            {
                if (ble_device_info.Id == device_info.Id)
                {
                    break;
                }
                else
                {
                    index++;
                }
            }
            if (index < BleDevices.Count)
            {
                ExecuteOnMainThread.Invoke(() => { BleDevices.RemoveAt(index: index); });
            }
        }
Exemplo n.º 3
0
        private void OnAltitudeChanged(AltimeterService.Altitude altitude, Int16 value)
        {
            switch (altitude)
            {
            case AltimeterService.Altitude.MainAltitude:
            {
                ExecuteOnMainThread.BeginInvoke(() => { lblMainAlti.Text = value.ToString() + "m"; });
                break;
            }

            case AltimeterService.Altitude.Altitude1:
            {
                ExecuteOnMainThread.BeginInvoke(() => { lblAlti1.Text = value.ToString() + "m"; });
                break;
            }

            case AltimeterService.Altitude.Altitude2:
            {
                ExecuteOnMainThread.BeginInvoke(() => { lblAlti2.Text = value.ToString() + "m"; });
                break;
            }

            case AltimeterService.Altitude.Altitude3:
            {
                ExecuteOnMainThread.BeginInvoke(() => { lblAlti3.Text = value.ToString() + "m"; });
                break;
            }

            case AltimeterService.Altitude.Altitude4:
            {
                ExecuteOnMainThread.BeginInvoke(() => { lblAlti4.Text = value.ToString() + "m"; });
                break;
            }

            default:
            {
                break;
            }
            }
        }
Exemplo n.º 4
0
 private void IBleStack_DeviceDiscovered(IBleStack sender, BleDeviceInformation device_info)
 {
     ExecuteOnMainThread.Invoke(() => { BleDevices.Add(device_info); });
 }
Exemplo n.º 5
0
 private void OnAccelerationChanged(Byte value)
 {
     ExecuteOnMainThread.BeginInvoke(() => { lblAcceleration.Text = value.ToString() + "g"; });
 }
Exemplo n.º 6
0
 private void OnVarioChanged(Int16 value)
 {
     ExecuteOnMainThread.BeginInvoke(() => { lblVario.Text = value.ToString() + "m/s"; });
 }
Exemplo n.º 7
0
 private void OnTemperatureChanged(Int16 value)
 {
     ExecuteOnMainThread.BeginInvoke(() => { lblTemperature.Text = value.ToString() + "°C"; });
 }
Exemplo n.º 8
0
 private void OnPressureChanged(UInt32 value)
 {
     ExecuteOnMainThread.BeginInvoke(() => { lblPressure.Text = value.ToString() + "mbar"; });
 }
Exemplo n.º 9
0
 private void OnTrackAngleChanged(UInt16 value)
 {
     ExecuteOnMainThread.BeginInvoke(() => { lblTrackAngle.Text = value.ToString() + "°"; });
 }
Exemplo n.º 10
0
 private void OnLongitudeChanged(double value)
 {
     ExecuteOnMainThread.BeginInvoke(() => { lblLongitude.Text = value.ToString() + "°"; });
 }
Exemplo n.º 11
0
 private void OnSpeedChanged(UInt16 value)
 {
     ExecuteOnMainThread.BeginInvoke(() => { lblSpeed.Text = value.ToString() + "m/s"; });
 }