Datalogic .NET SDK

GetBatteryLevel (Method)

 

Syntax

 

   public static Int32 GetBatteryLevel();

 

 

Class                           : Device

Namespace                : Datalogic.API

Assembly                   : Datalogic.API.DLL

 

 

Description

Retrieves charge level of the main battery.

 

 

Parameters Table

 

Type

Parameter

Description

[in]

void

-

-

 

 

 

 

[returns]

Int32

 

 

The value of the batteries remaining charge in percentage of the full battery charge is returned on success, otherwise Device.

[on error]

Device.DLError

 

If the battery level could not be obtained it returns Device.DLError.

 

 

Example

      

       private void btnBatteryInfo_Click(object sender, EventArgs e)

       {

      

             /* Get Device.GetBatteryLevel() and add it into a listView control */

            listView1.Items.Add(new ListViewItem(new string[]

                                  { "Battery Level:",

                                  Device.GetBatteryLevel().ToString() }));

       }

 

 

 

 

See Also

Device.BatteryInfo (Sub-Class), Device.DLError (Constant Member), Example #024.

 

Copyright © Datalogic ADC. All Right Reserved