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


11121
11122
11123
# File 'Monkeybrains.rb', line 11121

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


11129
11130
11131
# File 'Monkeybrains.rb', line 11129

def charging
  @charging
end

freeMemoryToybox::Lang::Number

The current free memory in bytes.

Returns:

Since:

  • 1.0.0


11139
11140
11141
# File 'Monkeybrains.rb', line 11139

def freeMemory
  @freeMemory
end

totalMemoryToybox::Lang::Number

The total available memory in bytes.

Returns:

Since:

  • 1.0.0


11144
11145
11146
# File 'Monkeybrains.rb', line 11144

def totalMemory
  @totalMemory
end

usedMemoryToybox::Lang::Number

The memory used by the application in bytes.

Returns:

Since:

  • 1.0.0


11134
11135
11136
# File 'Monkeybrains.rb', line 11134

def usedMemory
  @usedMemory
end