Keapigetbatterystate, 3 keapigetbatterystate – Kontron KEAPI User Manual

Page 16

Advertising
background image

Software specification for Kontron EAPI

16

Description:

Provides information about selected battery.

Parameters:

in/out

Parameter name

Description

in

boardHandle

Handle of the selected board

in

batteryNr

Requested battery's number. Numbers start with zero.

out

pBatteryInfo

Returned

BATTERY_INFO

structure

Structure used:

typedef struct

Battery_Info

{

KEAPI_CHAR

deviceName[MAX_STR]; // Device name

KEAPI_CHAR

type[MAX_STR];

// LION, NiCd, NiMH…

KEAPI_CHAR

serialNumber[MAX_STR]; // Serial number

KEAPI_INT32

designedVoltage;

// Designed voltage in mV

KEAPI_INT32

designedCapacity;

// Designed capacity of fully

charged battery in mAh

KEAPI_INT32

fullyChargedCapacity; // Real capacity of fully charged

battery in mAh

KEAPI_INT32

cycleCount;

// Number of charge/discharge cycles

experienced during lifetime
}

BATTERY_INFO

, *

PBATTERY_INFO

;

2.7.3 KEApiGetBatteryState

KEAPI_CALLTYPE

KEAPI_UINT32

KEApiGetBatteryState (

KEAPI_UINT32

boardHandle,

KEAPI_INT32

batteryNr,

PBATTERY_STATE

pBatteryState

);

Description:

Provides information about selected battery.

Parameters:

in/out

Parameter name

Description

in

boardHandle

Handle of the selected board

in

batteryNr

Requested battery's number. Numbers start with zero

out

pBatteryState

Pointer to a

BATTERY_STATE

structure

POWER_STATE_CHARGING, 0

POWER_STATE_CHARGED, 1

POWER_STATE_DISCHARGING, 2

Structure used:

typedef struct

BatteryState

{

KEAPI_INT32

powerState;

// Current power state - charging = 0,

charged = 1, discharging = 2

KEAPI_INT32

fullBatteryRemainingTime;

// Remaining time in seconds

when battery is full and AC power unplugged

KEAPI_INT32

remainingTime; // Remaining time in seconds

KEAPI_INT32

remainingCapacity; // Remaining capacity in mAh

KEAPI_INT32

currentVoltage; // Current voltage in mV

KEAPI_INT32

rate;

// Current charging/discharging rate in mA

Advertising