Exemple #1
0
void UpdateBatteryInfos(void) {

  #if (WINDOWSPC>0)
  return;
  #else

  BATTERYINFO BatteryInfo; 
  BatteryInfo.acStatus = 0;

  #ifdef PNA
  if (DeviceIsGM130) {
	PDABatteryPercent = GM130PowerLevel();
	PDABatteryStatus =  GM130PowerStatus();
	PDABatteryFlag =    GM130PowerFlag();

	PDABatteryTemperature = 0;
  } else 
  #endif
  if (GetBatteryInfo(&BatteryInfo)) {
    PDABatteryPercent = BatteryInfo.BatteryLifePercent;
    PDABatteryTemperature = BatteryInfo.BatteryTemperature; 
    PDABatteryStatus=BatteryInfo.acStatus;
    PDABatteryFlag=BatteryInfo.chargeStatus;

    // All you need to display extra Battery informations...
    //	TCHAR vtemp[1000];
    //	_stprintf(vtemp,_T("Battpercent=%d Volt=%d Curr=%d AvCurr=%d mAhC=%d Temp=%d Lifetime=%d Fulllife=%d\n"),
    //		BatteryInfo.BatteryLifePercent, BatteryInfo.BatteryVoltage, 
    //		BatteryInfo.BatteryCurrent, BatteryInfo.BatteryAverageCurrent,
    //		BatteryInfo.BatterymAHourConsumed,
    //		BatteryInfo.BatteryTemperature, BatteryInfo.BatteryLifeTime, BatteryInfo.BatteryFullLifeTime);
    //	StartupStore( vtemp );
  } 
  #endif
}
Exemple #2
0
void UpdateBatteryInfos(void) {

  BATTERYINFO BatteryInfo; 
  BatteryInfo.acStatus = Battery::UNKNOWN;

  #ifdef PNA
  if (DeviceIsGM130) {
	PDABatteryPercent = GM130PowerLevel();
	PDABatteryStatus =  GM130PowerStatus();
	PDABatteryFlag =    GM130PowerFlag();

	PDABatteryTemperature = 0;
	HaveBatteryInfo=true;
  } else 
  #endif
  if (GetBatteryInfo(&BatteryInfo)) {
    PDABatteryPercent = BatteryInfo.BatteryLifePercent;
    PDABatteryTemperature = BatteryInfo.BatteryTemperature; 
    PDABatteryStatus=BatteryInfo.acStatus;
    PDABatteryFlag=BatteryInfo.chargeStatus;

    #if TESTBENCH
    if (HaveBatteryInfo==false)
        StartupStore(_T("... LKBatteryManager: HaveBatteryInfo  ENABLED%s"),NEWLINE);
    #endif
    HaveBatteryInfo=true;

    // All you need to display extra Battery informations...
    //	TCHAR vtemp[1000];
    //	_stprintf(vtemp,_T("Battpercent=%d Volt=%d Curr=%d AvCurr=%d mAhC=%d Temp=%d Lifetime=%d Fulllife=%d\n"),
    //		BatteryInfo.BatteryLifePercent, BatteryInfo.BatteryVoltage, 
    //		BatteryInfo.BatteryCurrent, BatteryInfo.BatteryAverageCurrent,
    //		BatteryInfo.BatterymAHourConsumed,
    //		BatteryInfo.BatteryTemperature, BatteryInfo.BatteryLifeTime, BatteryInfo.BatteryFullLifeTime);
    //	StartupStore( vtemp );
  } else {
      #if TESTBENCH
      if (HaveBatteryInfo==true)
          StartupStore(_T("... LKBatteryManager: HaveBatteryInfo DISABLED%s"),NEWLINE);
      #endif
      HaveBatteryInfo=false;

  }
  battInitialized=true;
}