Ejemplo n.º 1
0
        internal async void UpdateBattery()
        {
            try
            {
                while (isActive)
                {
                    battery = await device.SendBatteryLevelCmd();

                    await AsyncUtils.YieldToMainThread();

                    if (label != null)
                    {
                        label.SubtitleText = $"Battery: {battery * 100}";
                    }
                    await Task.Delay(1000 * 10);
                }
            }
            catch (Exception)
            {
                //maybe device dissconnected during cmd
            }
        }