Class: Toybox::System::Stats

Inherits:
Lang::Object show all

Overview

Represents various statistics available on a device, such as the battery charge and memory use.

Examples:

using Toybox.System;
var myStats = System.getSystemStats();
System.println(myStats.battery);
System.println(myStats.totalMemory);

See Also:

Since:

  • 1.0.0

Instance Attribute Summary collapse

Method Summary

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Attribute Details

batteryToybox::Lang::Float

Note:

Some devices may report slightly less than 100% charge immediately after being removed from the charging cradle or cable. While the device is on the charger, the charger will disable itself after the battery charges to 100%. The battery will then very slowly discharge until it hits a hysteresis threshold, at which point the charger will reactivate. This is intentionally done to extend the life of the battery if the device is left on the charger for a long time. Garmin artificially locks the charge indicator on the charge page to 100% once the unit reaches full charge to mask this minor charge cycle fluctuation.

The remaining battery life as a percentage.

Returns:

Since:

  • 1.0.0



9271
9272
9273
# File 'Monkeybrains.rb', line 9271

def battery
  @battery
end

chargingToybox::Lang::Boolean

Battery charging indicator. This will be set to true if the device is connected to the charging cradle or cable whether or not the device is fully charged.

Returns:

See Also:

Since:

  • 3.0.0



9279
9280
9281
# File 'Monkeybrains.rb', line 9279

def charging
  @charging
end

freeMemoryToybox::Lang::Number

The current free memory in bytes.

Returns:

Since:

  • 1.0.0



9289
9290
9291
# File 'Monkeybrains.rb', line 9289

def freeMemory
  @freeMemory
end

totalMemoryToybox::Lang::Number

The total available memory in bytes.

Returns:

Since:

  • 1.0.0



9294
9295
9296
# File 'Monkeybrains.rb', line 9294

def totalMemory
  @totalMemory
end

usedMemoryToybox::Lang::Number

The memory used by the application in bytes.

Returns:

Since:

  • 1.0.0



9284
9285
9286
# File 'Monkeybrains.rb', line 9284

def usedMemory
  @usedMemory
end