×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Dec 2006
    Posts
    76

    Creating a GPRS access point

    Is there a documentation about creating Access point on series 60 3rd edition devices?

    I have found some code in this forum that I have tried.
    I can see the GRPS access point that I create on the device. But this access point does not connect. I checked the visible parameters in the phone and they are exactly the same as the one of a manually created access point that works fine.
    Now I do not know where to look at , in order to find the error in my code: I cannot find any documentation from Nokia or Symbian; I cannot even retrieve the database from the device because its access is protected.

    Here is my code:

    int XAccessPoint::create()
    {
    TUint32 gprsId=-1;
    TUint32 iapId=-1;
    TUint32 NetId=-1;
    TUint32 BearerId=-1;
    TUint32 LocId=-1;
    TUint32 WapId=-1;
    TUint32 WapBearerId=-1;

    int err;
    int error;
    TPtrC pconnectionName( (const TUint16 *)((XString *)connectionName_)->getWChars() );
    TPtrC papn( (const TUint16 *)((XString *)apn_)->getWChars() );
    TPtrC pusername( (const TUint16 *)((XString *)user_)->getWChars() );
    TPtrC ppassword( (const TUint16 *)((XString *)password_)->getWChars() );
    String coBearer = new XString(connectionName_);
    ((XString *)coBearer)->append(" Bearer");
    TPtrC pbearer( (const TUint16 *)((XString *)coBearer)->getWChars() );
    String coNetwork = new XString(connectionName_);
    ((XString *)coNetwork)->append(" Network");
    TPtrC pnetwork( (const TUint16 *)((XString *)coNetwork)->getWChars() );
    String coLocation = new XString(connectionName_);
    ((XString *)coLocation)->append(" Location");
    TPtrC plocation( (const TUint16 *)((XString *)coLocation)->getWChars() );
    String coGprs = new XString(connectionName_);
    ((XString *)coGprs)->append(" GPRS");
    TPtrC pgprs( (const TUint16 *)((XString *)coGprs)->getWChars() );
    String coWapAp = new XString(connectionName_);
    //((XString *)coWapAp)->append(" WAP");
    TPtrC pwapap( (const TUint16 *)((XString *)coWapAp)->getWChars() );
    String coWapBearer = new XString(connectionName_);
    ((XString *)coWapBearer)->append(" WAP Bearer");
    TPtrC pwapbearer( (const TUint16 *)((XString *)coWapBearer)->getWChars() );
    //-----------------GPRS---------------------------------
    CCommsDbTableView* view = commDb_->OpenTableLC(TPtrC(OUTGOING_GPRS));
    //CleanupStack::PushL(view);
    TRAP(error , err = view->InsertRecord(gprsId));
    view->WriteTextL(TPtrC(COMMDB_NAME), pgprs);
    view->WriteTextL(TPtrC(GPRS_APN), papn);
    view->WriteUintL(TPtrC(GPRS_PDP_TYPE), 0);
    view->WriteBoolL(TPtrC(GPRS_IP_ADDR_FROM_SERVER), ETrue); // Changed
    view->WriteBoolL(TPtrC(GPRS_IP_DNS_ADDR_FROM_SERVER), ETrue); //Changed
    view->WriteBoolL(TPtrC(GPRS_IP6_DNS_ADDR_FROM_SERVER), EFalse);
    view->WriteTextL(TPtrC(GPRS_IF_AUTH_NAME), pusername);
    view->WriteTextL(TPtrC(GPRS_IF_AUTH_PASS), ppassword);
    view->WriteBoolL(TPtrC(GPRS_IF_PROMPT_FOR_AUTH), EFalse);
    view->WriteUintL(TPtrC(SERVICE_IF_AUTH_RETRIES), 0);
    view->WriteTextL(TPtrC(GPRS_IF_NETWORKS), _L("tcp,udp,icmp,icmp6"));
    view->WriteBoolL(TPtrC(GPRS_HEADER_COMPRESSION), EFalse);
    view->WriteBoolL(TPtrC(GPRS_DATA_COMPRESSION), EFalse);
    view->WriteUintL(TPtrC(GPRS_REQ_PRECEDENCE), 0);
    view->WriteUintL(TPtrC(GPRS_REQ_DELAY), 0);
    view->WriteUintL(TPtrC(GPRS_REQ_RELIABILITY), 0);
    view->WriteUintL(TPtrC(GPRS_REQ_PEAK_THROUGHPUT), 0);
    view->WriteUintL(TPtrC(GPRS_REQ_MEAN_THROUGHPUT), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_PRECEDENCE), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_DELAY), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_RELIABILITY), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_PEAK_THROUGHPUT), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_MEAN_THROUGHPUT), 0);
    view->WriteBoolL(TPtrC(GPRS_ANONYMOUS_ACCESS), ETrue); // Changer
    view->WriteBoolL(TPtrC(GPRS_ENABLE_LCP_EXTENSIONS), ETrue);
    view->WriteBoolL(TPtrC(GPRS_DISABLE_PLAIN_TEXT_AUTH), EFalse);
    view->WriteUintL(TPtrC(GPRS_AP_TYPE), EIspTypeInternetOnly);
    view->WriteUintL(TPtrC(GPRS_QOS_WARNING_TIMEOUT), -1);
    err = view->PutRecordChanges();
    CleanupStack::PopAndDestroy(view);
    //delete view;
    //----------------Location----------------------

    view = commDb_->OpenTableLC(TPtrC(LOCATION));
    //CleanupStack::PushL(view);
    view->InsertRecord(LocId);
    view->WriteTextL(TPtrC(COMMDB_NAME), plocation);
    view->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("+"));
    view->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
    view->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("33"));
    view->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT), 0);
    view->WriteBoolL(TPtrC(LOCATION_MOBILE), ETrue);
    view->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL), EFalse);
    view->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE), EFalse);
    err = view->PutRecordChanges();
    CleanupStack::PopAndDestroy(view);
    //delete view;
    //----------------Network-----------------------

    view = commDb_->OpenTableLC(TPtrC(NETWORK));
    //CleanupStack::PushL(view);
    err = view->InsertRecord(NetId);
    view->WriteTextL(TPtrC(COMMDB_NAME), pnetwork);
    err=view->PutRecordChanges();
    CleanupStack::PopAndDestroy(view);
    //delete view;



    //---------------Bearer-----------------------
    _LIT(KAgentName, "wsocka.agt");
    _LIT(KIfName, "wsocki");
    _LIT(KLddName, "foo");
    view = commDb_->OpenTableLC(TPtrC(LAN_BEARER));
    //CleanupStack::PushL(view);
    err|=view->InsertRecord(BearerId);

    view->WriteTextL(TPtrC(COMMDB_NAME), pbearer);
    view->WriteTextL(TPtrC(IF_NAME), KIfName);
    view->WriteTextL(TPtrC(LAN_BEARER_LDD_NAME), KIfName);
    view->WriteTextL(TPtrC(LAN_BEARER_PDD_NAME), KIfName);
    view->WriteTextL(TPtrC(AGENT_NAME), KAgentName);

    view->WriteUintL(TPtrC(LAST_SOCKET_ACTIVITY_TIMEOUT), -1);
    view->WriteUintL(TPtrC(LAST_SESSION_CLOSED_TIMEOUT), -1);
    view->WriteUintL(TPtrC(LAST_SOCKET_CLOSED_TIMEOUT), -1);

    err|=view->PutRecordChanges();
    CleanupStack::PopAndDestroy(view);
    //delete view;



    // -----------IAP --------------------------
    view = commDb_->OpenTableLC(TPtrC(IAP));
    //CleanupStack::PushL(view);

    err |= view->InsertRecord(iapId);

    view->WriteTextL(TPtrC(COMMDB_NAME), pconnectionName);
    view->WriteTextL(TPtrC(IAP_SERVICE_TYPE), TPtrC(OUTGOING_GPRS));
    view->WriteUintL(TPtrC(IAP_SERVICE), gprsId);
    view->WriteUintL(TPtrC(IAP_NETWORK_WEIGHTING), 0);
    view->WriteUintL(TPtrC(IAP_NETWORK), NetId);
    view->WriteUintL(TPtrC(IAP_BEARER),BearerId);
    view->WriteTextL(TPtrC(IAP_BEARER_TYPE), TPtrC(LAN_BEARER));
    view->WriteUintL(TPtrC(IAP_LOCATION), LocId);

    err |= view->PutRecordChanges(EFalse, EFalse);
    CleanupStack::PopAndDestroy(view);


    //---------------WAP AP--------------------------------------------

    view = commDb_->OpenTableLC(TPtrC(WAP_ACCESS_POINT));
    err|=view->InsertRecord(WapId);
    view->WriteTextL(TPtrC(COMMDB_NAME), pwapap);
    view->WriteTextL(TPtrC(WAP_CURRENT_BEARER), TPtrC(WAP_IP_BEARER));

    err|=view->PutRecordChanges();
    CleanupStack::PopAndDestroy(view);


    //------------ WAP Bearer
    view = commDb_->OpenTableLC(TPtrC(WAP_IP_BEARER));
    err|=view->InsertRecord(WapBearerId);
    view->WriteTextL(TPtrC(COMMDB_NAME), pwapbearer);
    view->WriteUintL(TPtrC(IAP), iapId);
    view->WriteUintL(TPtrC(WAP_ACCESS_POINT_ID), WapId);
    view->WriteUintL(TPtrC(WAP_WSP_OPTION), EWapWspOptionConnectionless); // A voir
    view->WriteBoolL(TPtrC(WAP_SECURITY), EFalse); \
    view->WriteTextL(TPtrC(WAP_GATEWAY_ADDRESS), _L("0.0.0.0"));
    view->WriteUintL(TPtrC(WAP_PROXY_PORT), 0);
    err|=view->PutRecordChanges();
    CleanupStack::PopAndDestroy(view);

    //delete view;
    if(err!=KErrNone)
    return -1;

    return iapId;
    }

  2. #2
    Registered User
    Join Date
    Feb 2004
    Posts
    5

    Re: Creating a GPRS access point

    Hi there - Im afraid I dont know the answer to your question. However I am interested to know if your accesspoint code can be loaded as a .sis/c application onto a Series 60 device. I have a requirement to be able to create an access point configuration for an E50 device that defines a private GPRS APN and then autoload that AP from a memory card inserted into the device, via the 'private\10202dce\' directory. So - Id be really interested to know if your code would work in this manner once its fixed ?

    Thanks,

    Max

  3. #3
    Super Contributor
    Join Date
    Jul 2006
    Location
    Oulu, Finland.
    Posts
    1,174

    Re: Creating a GPRS access point

    This example shows, how to create an access point:
    http://wiki.forum.nokia.com/index.ph...e_access_point

  4. #4
    Regular Contributor
    Join Date
    Dec 2006
    Posts
    76

    Re: Creating a GPRS access point

    Max,

    there two possibilities to create an access point:
    1- By program
    2- By sending a Configuration SMS (OMA sms) to the phone.
    This second solution is better specially if your phone has no predefined
    access points, because this can initiate a deployment process.

    In the example that I gave there are two mistakes:
    1-
    view->WriteTextL(TPtrC(GPRS_IF_NETWORKS), _L("tcp,udp,icmp,icmp6"));
    must be replaced by
    view->WriteTextL(TPtrC(GPRS_IF_NETWORKS), _L("ip"));

    2-
    You have to enclose all the code in a transaction:
    commDb_->BeginTransaction() and commDb_->CommitTransaction()

    That works fine on my device

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    5

    Re: Creating a GPRS access point

    Thanks for your replies. Much appreciated - we will probably go the OMA SMS provisioning route to be honest. But your advice has been most helpfull

    Max

Similar Threads

  1. Connecting J2ME application to Internet using WAP access point?
    By khurshed79 in forum Mobile Java Networking & Messaging & Security
    Replies: 12
    Last Post: 2012-09-12, 09:53
  2. Access Point & Packet Data Setting on Nokia 6633
    By ramusunkara in forum Wired and Wireless interfaces (Closed)
    Replies: 1
    Last Post: 2007-08-19, 03:44
  3. Replies: 1
    Last Post: 2007-08-10, 08:20
  4. GPRS Access point prompt
    By krtrivdi in forum Symbian
    Replies: 4
    Last Post: 2007-01-10, 03:28
  5. Replies: 1
    Last Post: 2006-08-18, 09:03

Posting Permissions

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