×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2006
    Location
    Germany
    Posts
    28

    Question Battery Charge level & Info: Model Support?

    Hi,

    I need to get battery charge level for my application, and I've tried the code below that uses etelbgsm.h:

    -------------------------
    TBuf<50> aValue;
    MBasicGsmPhoneBatteryAndPower::TBatteryInfo binfo;
    TInt test = phone.GetBatteryInfo(binfo);
    if (test == KErrNone)
    {
    aValue.Format(_L("BATT CHARGE LEVEL: %d"), binfo.iChargeLevel);
    aValue.Append(_L("%\f"));

    switch (binfo.iStatus)
    {
    case MBasicGsmPhoneBatteryAndPower::EPoweredByBattery:
    {
    aValue.Append(_L("BATTERY POWERED"));
    break;
    }
    case MBasicGsmPhoneBatteryAndPower::EBatteryConnectedButExternallyPowered:
    {
    aValue.Append(_L("EXT PWR CONNECTED"));
    break;
    }
    case MBasicGsmPhoneBatteryAndPower::ENoBatteryConnected:
    {
    aValue.Append(_L("NO BATT CONNECTED"));
    break;
    }
    case MBasicGsmPhoneBatteryAndPower::EPowerFault:
    {
    aValue.Append(_L("POWER FAULT"));
    break;
    }
    }
    }
    ----------------------------

    I've tested the code on Nokia 6630 and looks like "test" results in KErrNotSupported.

    Can anyone tell my what models are supported by this API? or suggests another API?

    My target SDK is 2nd edition.

    Thanks,

    -yazan

    P.S. I've also tried:

    --------------
    RSystemAgent systemAgent;
    User::LeaveIfError(systemAgent.Connect());
    TInt strength = systemAgent.GetState(KUidBatteryStrength);
    -------------

    But the application panics when connecting to the system agent!
    Welcome Symbian ;-)

  2. #2
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: Battery Charge level & Info: Model Support?

    Goto Technical Library and search for:TSS000338.

Similar Threads

  1. Nokia 7650 support Bluetooth audo?
    By ovjo12 in forum Bluetooth Technology
    Replies: 5
    Last Post: 2003-07-17, 18:50
  2. Sound.FORMAT_WAV and Nokia Phone Model Support
    By gregr170 in forum Mobile Java General
    Replies: 3
    Last Post: 2003-05-22, 13:44
  3. Does the PC Connection SDK support WTAI the Call Control model?
    By kenrwilson in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-10-04, 12:12
  4. DTL-1 Connectivity Pack Support and Updates - IMPORTANT INFO
    By andygascoigne in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-07-12, 04:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×