Aila_GetChargerWattage
Return current charger wattage.
Signature
- Objective-C
- Swift
void Aila_GetChargerWattage(void (^completion)(int chargerWattage));
func Aila_GetChargerWattage(_ completion: @escaping (Int32) -> Void)
Parameters
completion- Block/closure called with the charger wattage
Description
Returns the negotiated charger power contract for the connected Aila hardware (on devices equipped with powered hubs). If the call succeeds, the power contract is returned as the chargerWattage parameter. If the call fails, the parameter is 0.
Note that this value only indicates the power capabilities advertised by the charger, which may differ from actual power delivered.
Usage
- Objective-C
- Swift
Aila_GetChargerWattage(^(int chargerWattage) {
if (chargerWattage > 0) {
NSLog(@"Charger Wattage: %dW", chargerWattage);
} else {
NSLog(@"Failed to retrieve charger wattage");
}
});
Aila_GetChargerWattage { chargerWattage in
if chargerWattage > 0 {
print("Charger Wattage: \(chargerWattage)W")
} else {
print("Failed to retrieve charger wattage")
}
}
See Also
- AilaPowerManagementMode - Power management settings
- Aila_GetConnectionInfo - Get connection type