×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Read IAPIDs without a view

    Hello list,

    I am referring to the following link, which has code for reading all the IAPs in a device:
    http://wiki.forum.nokia.com/index.ph...rom_the_device
    But in the code, a CCommsDbTableView is used to display the IAPs.

    I am right now facing an issue, wherein I get a System Error -28 when I launch my application on the emulator. There is a similar issue in the following link
    http://discussion.forum.nokia.com/fo...ror-%28-28-%29
    I need to pass a valid IAPID while invoking the NewL() method of CSIPConnection class.

    How can I retrieve an IAPID from the system, possibly the default IAPID, without having to use a view to display it to the user?

    TIA
    Vin

  2. #2
    Registered User
    Join Date
    Feb 2007
    Location
    India
    Posts
    1,128

    Re: Read IAPIDs without a view

    Hi Vnp,

    You can read default IAP by use of CMDBSession and CCDConnectionPrefsRecord.
    CCDConnectionPrefsRecord has member variable iDefaultIAP which give you a default IAP..

    Hope, It'll help you

  3. #3
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: Read IAPIDs without a view

    Quote Originally Posted by kis_spn View Post
    Hi Vnp,

    You can read default IAP by use of CMDBSession and CCDConnectionPrefsRecord.
    CCDConnectionPrefsRecord has member variable iDefaultIAP which give you a default IAP..

    Hope, It'll help you
    Hi,

    Thanks a lot for the suggestion. Is there some sample code? Especially, I would like to know the sequence of iniitializations before accessing the default IAP as you have mentioned.
    TIA
    Vin

  4. #4
    Registered User
    Join Date
    Feb 2007
    Location
    India
    Posts
    1,128

    Re: Read IAPIDs without a view

    Go through below mentioned code:

    TInt iap = KErrNotFound;
    CMDBSession* dbSession = CMDBSession::NewL(CMDBSession::LatestVersion());
    CleanupStack::PushL(dbSession);
    CCDConnectionPrefsRecord *connPrefRecord =
    static_cast<CCDConnectionPrefsRecord*> (CCDRecordBase::RecordFactoryL(
    KCDTIdConnectionPrefsRecord));
    CleanupStack::PushL(connPrefRecord);

    // Set the direction of connection
    connPrefRecord->iDirection = ECommDbConnectionDirectionOutgoing;
    connPrefRecord->iRanking = 1;
    if (connPrefRecord->FindL(*dbSession))
    iap = TInt(connPrefRecord->iDefaultIAP);

    CleanupStack::PopAndDestroy(2, dbSession);

  5. #5
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: Read IAPIDs without a view

    if (connPrefRecord->FindL(*dbSession))
    I could not find the mention of the method FindL() in the documentation for the CCDConnectionPerfsRcord or CCDRecordBase.
    Could you please clarify from which parent this method is inherited?

    TIA
    Vin

  6. #6
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: Read IAPIDs without a view

    Also, what are the header files that I should include for the definiton of CMDBSession and CCDConnectionPrefsRecord?
    As per the documentation, I should #include <CommsDatTypesV1_1.h> to access the definition of CCDConnectionPerfsRecord and link against commsdat.lib.
    But even after including this header file, I get an undefined identifier error for CCDConnectionPerfsRecord variable.

    TIA
    Vin

  7. #7
    Registered User
    Join Date
    Feb 2007
    Location
    India
    Posts
    1,128

    Re: Read IAPIDs without a view

    Add below mentioned of line...

    #include <metadatabase.h>
    #include <commsdattypesv1_1.h>
    using namespace CommsDat;

    TInt iap = KErrNotFound;
    CMDBSession* dbSession = CMDBSession::NewL(CMDBSession::LatestVersion());
    CleanupStack::PushL(dbSession);
    CCDConnectionPrefsRecord *connPrefRecord =
    static_cast<CCDConnectionPrefsRecord*> (CCDRecordBase::RecordFactoryL(
    KCDTIdConnectionPrefsRecord));
    CleanupStack::PushL(connPrefRecord);

    // Set the direction of connection
    connPrefRecord->iDirection = ECommDbConnectionDirectionOutgoing;
    connPrefRecord->iRanking = 1;
    if (connPrefRecord->FindL(*dbSession))
    iap = TInt(connPrefRecord->iDefaultIAP);

    CleanupStack::PopAndDestroy(2, dbSession);

  8. #8
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: Read IAPIDs without a view

    Thanks. That worked.
    Vin

  9. #9
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: Read IAPIDs without a view

    I get a KERNEXEC-3 for the following line:
    connPrefRecord->iRanking = 1;
    But there is no issue with the preceding line:
    connPrefRecord->iDirection = ECommDbConnectionDirectionOutgoing;

    Am I missing something?
    TIA
    Vin

  10. #10
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: Read IAPIDs without a view

    I had used
    CCDConnectionPrefsRecord *connPrefRecord =
    static_cast<CCDConnectionPrefsRecord*> (new (ELeave) CCDRecordBase(KCDTIdConnectionPrefsRecord));
    instead of what you had suggested:
    CCDConnectionPrefsRecord *connPrefRecord =
    static_cast<CCDConnectionPrefsRecord*> (CCDRecordBase::RecordFactoryL(
    KCDTIdConnectionPrefsRecord));

    I thought there should not be any difference. I reverted to your suggestion and the problem disappeared.
    Vin

Similar Threads

  1. Replies: 6
    Last Post: 2009-05-15, 01:06
  2. Replies: 6
    Last Post: 2008-12-09, 10:47
  3. Replies: 1
    Last Post: 2002-10-29, 13:25
  4. Replies: 0
    Last Post: 2002-10-28, 10:14

Posting Permissions

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