Set the default access point of Symbian

Source: Internet
Author: User

Void setdefaultiap (tint aiaptype, tuint32 & aiapid)
{
Tint ret = kerrnone;
Tbuf <kcommsdbsvrmaxcolumnnamelength> apnname;
Tbuf <10> defapn;
Tuint32 fakeiapid;
Aiapid = 0;
If (aiaptype = 0)
Defapn = _ L ("cmnet ");
Else if (aiaptype = 1)
Defapn = _ L ("cmwap ");
Else if (aiaptype = 2) // Simulator
Defapn = _ L ("Winsock ");
Ccommsdatabase * commdb = ccommsdatabase: newl (edatabasetypeiap );
Cleanupstack: pushl (commdb );
Ccommsdbtableview * commview = commdb-> opentablelc (tptrc (outgoing_wcdma ));
If (commview-> gotofirstrecord () = kerrnone)
{
Do
{
Commview-> readtextl (tptrc) upls_apn, apnname );
Commview-> readuintl (tptrc (commdb_id), fakeiapid );
If (apnname. Find (defapn)> = 0) // case insensitive

{
Ccommsdbtableview * piapview = commdb-> openviewmatchinguintlc (
Tptrc (IAP), tptrc (iap_service), fakeiapid );
Tint nerr = piapview-> gotofirstrecord ();
If (nerr = kerrnone)
{
Piapview-> readuintl (tptrc (commdb_id), fakeiapid );
Aiapid = fakeiapid;
Cleanupstack: popanddestroy (); // piapview
Break;
}
Cleanupstack: popanddestroy (); // piapview
}
}
While (commview-> gotonextrecord () = kerrnone );
}
Cleanupstack: popanddestroy (2 );
}
There are so many access point parameters in Symbian that they are really complicated ~~ Record it in case you forget it ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.