Datalogic .NET SDK
SetBatteryThreshold (Method)
Syntax
public static Boolean SetBatteryThreshold(BatteryThreshold batThreshold);
Description
Sets the warning thresholds for the main or backup battery.
Parameters Table
|
Type |
Parameter |
Description |
[in] |
BatteryThreshold |
batThreshold |
A Device.BatteryThreshold value. This contains the low and critical battery thresholds as a percentage of the total battery charge at. The allowed range of this variable is 0 to 100. Setting the value outside of this range will cause the function to return false. |
|
|
|
|
[returns] |
Boolean
|
|
TRUE if the function succeeds, FALSE otherwise. |
[on error] |
FALSE |
|
|
Example
private void btnBattThrSET_Click(object sender, EventArgs e) { bool b = false; Device.BatteryThreshold oBatteryThresh = new Device.BatteryThreshold(); Device.BatteryThreshold oBatteryThresh_Get = new Device.BatteryThreshold();
oBatteryThresh.Critical = (ushort)(int.Parse(txtSetBattThCrit.Text)); oBatteryThresh.Low = (ushort)(int.Parse(txtSetBattThLow.Text));
b = Device.SetBatteryThreshold(oBatteryThresh);
b = Device.GetBatteryThreshold(out oBatteryThresh_Get); }
|
See Also
Device.BatteryThreshold (Struct), Example #027.
Copyright © Datalogic ADC. All Right Reserved