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


9512
9513
9514
# File 'Monkeybrains.rb', line 9512

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


9520
9521
9522
# File 'Monkeybrains.rb', line 9520

def charging
  @charging
end

freeMemoryToybox::Lang::Number

The current free memory in bytes.

Returns:

Since:

  • 1.0.0


9530
9531
9532
# File 'Monkeybrains.rb', line 9530

def freeMemory
  @freeMemory
end

totalMemoryToybox::Lang::Number

The total available memory in bytes.

Returns:

Since:

  • 1.0.0


9535
9536
9537
# File 'Monkeybrains.rb', line 9535

def totalMemory
  @totalMemory
end

usedMemoryToybox::Lang::Number

The memory used by the application in bytes.

Returns:

Since:

  • 1.0.0


9525
9526
9527
# File 'Monkeybrains.rb', line 9525

def usedMemory
  @usedMemory
end