getMinMaxFrequencies static method

Future<MinMaxFrequency?> getMinMaxFrequencies(
  1. int coreNumber
)

Gets the current min and max frequencies for the specified coreNumber

Implementation

static Future<MinMaxFrequency?> getMinMaxFrequencies(int coreNumber) async {
  try {
    if (_minMaxFrequencies.containsKey(coreNumber)) {
      return _minMaxFrequencies[coreNumber];
    }
    var map = Map<int, int>.from(await (_channel
            .invokeMethod('getMinMaxFrequencies', {"coreNumber": coreNumber})
        as FutureOr<Map<dynamic, dynamic>>));
    var minMax = MinMaxFrequency(map.keys.first, map.values.first);
    _minMaxFrequencies[coreNumber] = minMax;
    return minMax;
  } on PlatformException catch (e) {
    throw 'Failed to retrieve current frequency for the core ${e.code}: ${e.message}';
  }
}