[Previous] [Next] [Contents]

CHAPTER 6. PHONE INTERFACE

 

6.7 DATA COMMUNICATION FLOW VIA PPP

A. Environment analysis

CDMA wireless data communication in China has various environments and complexes.
We can separate them into following terms;

  • CDMA 2000 1x
  • 2G(is95A)
  • More detailed terms could be defined by followings;

  • Wireless data communication through WAP

  • Wireless data communication through TCP/IP

  • Wireless data communication through U-IMAP, or GPS

  • Etc.
  • Please review the following example code.

    [0] app check current phone state with MzPhoneNotifier - First, the application requests wireless network status via investigating PHONE status.

    LXT_PHONE_STATE state = MzPhoneNotifier::instance()->state() 
        if(state == LXT_STATE_STANDBY) || (state == LXT_STATE_DATA_SERVICED) 
        {
            go to step[1]
        }
        else
        {
            show_reject_message(); 
    }
    

    [1] app requests system parameter
    - The application requests wireless network status after it receives validated PHONE status.
    The example of validate signals are as follows;

    1x = 0xF1
    2G = 0xF2

    connect
         (
    	          MzPhoneNotifier::instance(),         
    			  this,         
    			  SIGNAL(changedNetworkState()),         
    			  SLOT(slot_MzPhoneNotifier_changedNetworkState(int))
         ); 
    	 
        MzActionCollection ac;     
        MzAction *pAction = new MzAction("", &ac, "actionPPPSystemParamRequest");     
        MzAction::activate("skywalker", pAction);     
        delete pAction; 
    	
        void slot_MzPhoneNotifier_changedNetworkState(int state)
        {
            if(state == 0xF1) // 1x
        {
                profile_name = 1X_WAP_in_CHINIA
                // profile_name = 1X_DATA_in_CHINIA
        }
        else if(state == 0xF2) // 2g
        {
                profile_name = 95A_WAP_in_CHINIA
                // profile_name = 95A_DATA_in_CHINIA
        }
        }
    

    [2] app send action to indicator
    - When application receives validated network response, then it demands approval to indicator through its profile.

    MzActionCollection ac; 
    MzAction *pAction = new MzAction("", &ac, "actionPPPAuthRequest");
     
    pAction->setText("qwapbrower?profile_name"); //pAction->setText("netriver?profile_name"); //pAction->setText("tracemessanger?profile_name");
    MzAction::activate("skywalker", pAction);
    delete pAction;

    [3] app receives action from indicator
    - The application shall receive approved signal from the indicator. Some example of approved signal is as follow;

  • accept - the example of "PPP is available or PPP service has been activated with same profile"

  • reject?0 - the example of "requested profile can not be found"

  • reject?1 - the example of "PPP is initial stage of connect with different profile"

  • reject?2 - the example of "PPP is already connected by user with different profile"

  • reject?3 - the example of "PPP forced to be disconnected by user" since another application is waiting to connect
  •  

    static MzAction *getClientAction (const char *name)
    {
    MzAction *actionClient = MzActionClient::instance()->actionCollection()->action(name);
    if (!actionClient) actionClient = new MzAction(MzActionClient::instance()->actionCollection(), name); return actionClient; }
    connect(getClientAction("actionPPPAuthResponse"), SIGNAL(activated(const QString &)), this, SLOT(slot_PPPAuthResponse(const QString &)));
    void slot_PPPAuthResponse(QString &data) { if (data == "reject?0") {
    } else if(data == "reject?1") {
    } ... else if(data == "accept") { network_processing(); } }

    [4] app send force connection action to indicator
    If PPP is already connected then it response 'accept' for same profile while different one gets 'reject2?2'.
    For this term, the application suggested to show 'warning dialog' which says 'PPP is not available due to other(different) profile's PPP usage'.
    If the user tries to disconnect other profile's PPP then follow action need to be transmitted.

    MzActionCollection ac;   
    MzAction *pAction = new MzAction("", &ac, "actionPPPAuthRequest"); 
    
    // ex) ppptest?1x_WAP_in_CHINA=super pAction->setText("qwapbrower?profile_name=super"); //pAction->setText("netriver?profile_name"); //pAction->setText("tracemessanger?profile_name");
    MzAction::activate("skywalker", pAction); delete pAction;

    As result, the additional parameter, "=super", shall be transmitted with "actionPPPAuthRequest" parameter.
    Then, current PPP is disconnected then it turns to IDLE mode which means 'none of application occupied PPP connection'.
    The application will try to take PPP procedures from step[0].
    It responses application about availability which was requested 'super' only. This is different from normal PPP procedure.
    It will wait the application which requested 'super' then turns to normal mode in terms of 'getting response failure'.

    [5] app emergency

  • In abnormal status of PPP, please follow instructions.
    Assuming that ppp is in abnormal status (after receive accept signal)

    actionPPPRetryIndication
    (receive action) LXT_STATE_DATA_SERVICED (do not wait LXT_STATE_DATA_SERVICED then wait next action)
  • actionPPPReadyIndication

  • After receive the action then the procedure will take from step 0.

    [6] app send out of connection action to indicator
    - Application should ask to indicator when it quits itself or no longer use of PPP service to let PPP service be disconnected.

    MzActionCollection ac;
    MzAction *pAction = new MzAction("", &ac, "actionPPPOutOfConnectionIndication");

    MzAction::activate("skywalker", pAction);
    delete pAction;

     

    B. Note

    Step [1] requests the current wireless network status (1x, 95A).
    It broadcasts network status to all applications when the status changed and requested to broadcast by other application too.
    In this situation, you MUST NOT insert any proceduable code to take next step in the slot
    because other application's response shall be received as well as with its own.
    The situation could be turned to 'loop' thus you need cautious.
    (Tip: As soon as you receive the first response then disconnect the slot from signal)

    void slot_MzPhoneNotifier_changedNetworkState(int state) 
    {
         disconnect
         (
              MzPhoneNotifier::instance(),
              SIGNAL(changedNetworkState())),
              0,
              0
         );
    ...
    }

     

    In step [2], the programmer MUST give the legible profile name otherwise the application shall receive 'reject signal'.
    The lower/upper character shall be identified differently therefore you need to careful for 'naming'.
    The legible profile names are as follow;

  • 1x_WAP_in_CHINA

  • 95A_WAP_in_CHINA

  • 95A_DATA_in_CHINA

  • 1x_DATA_in_CHINA

  • Step [3]
    (1) PPP is available to use, or PPP is connected by same profile,
    "accept"

    (2) the profile can not be found
    "reject?0"

    (3) PPP is in the process by other application
    "reject?1"

    (4) Other application with different profile occupies PPP service
    "reject?2"

     

    [ Note ]

    Download Data Communication Sample Source

    1. source code

    There exists of source which required for data communication (datacomm_source.tar.gz)

    2. Install

    a. download [datacomm_install.tar.gz] at [/usr/home/Linuette]
    b. de-compress [tar zxvf datacomm_install.tar.gz]
    c. Input [mail server] in the required field (middle of application field), then click [START]. It will receive the message(s) from POP3 server through 110 port atfer connect.


    [Previous] [Next] [Contents] MIZI Prizm 2.0.0