AN2385 Freescale Semiconductor / Motorola, AN2385 Datasheet
AN2385
Related parts for AN2385
AN2385 Summary of contents
Page 1
... Freescale Semiconductor, Inc. Application Note AN2385/D Rev. 0, 11/2002 GPRS Wireless Internet Connectivity Using DragonBall™ and Palm OS Based PDAs By Lalan J. Mishra This paper describes and provides source code for a reference application, called GSM- GPRS, which provides mobile Internet access on a personal digital assistant (PDA) based on Contents a DragonBall™ ...
Page 2
Freescale Semiconductor, Inc. GSM-GPRS Application Both dial-up and GPRS connections have hardware and software components associated with them. The Timeport™ 280 mobile phone has a built-in modem, and this modem is the major hardware component connecting the client (in this ...
Page 3
Freescale Semiconductor, Inc. Figure 1 illustrates the GUI command buttons. When a button is clicked, the PDA interacts with the mobile phone by sending modem AT commands. OFF Button When this button is clicked, the command AT+CKPD=e is sent. Figure ...
Page 4
Freescale Semiconductor, Inc. GSM-GPRS Application The generic form of key emulation AT commands is: character string showing the decimal ASCII value of the key being emulated. <CR> represents the 1-byte ASCII value of carriage return, which is 0x0D. For example, ...
Page 5
Freescale Semiconductor, Inc. Table 2. AT Commands for Modem Testing, Control, and Configuration (Continued) AT Commands AT+IPR = 57600 <CR> Sets the modem baud rate to 57600 bps. AT+IFC = 2, 2 <CR> Sets the modem to RTS-CTS based hardware ...
Page 6
Freescale Semiconductor, Inc. GSM-GPRS Application Figure 2. Execution State Diagram The sequence of AT commands (with 250 ms delay between consecutive commands) that is sent to the mobile phone device on clicking Go GPRS WWW is shown in Figure 3. ...
Page 7
Freescale Semiconductor, Inc. 4 Program Source Code The GSM-GPRS application is a single form (window) application. Event handling is limited to responding to button-click events, and therefore is very simple. The code execution flow through various functions is shown in ...
Page 8
Freescale Semiconductor, Inc. Program Source Code typedef struct { UInt8 replaceme; } StarterAppInfoType; typedef StarterAppInfoType* StarterAppInfoPtr; //-----------------------------------------------------------------------// //--------------------- Global Variables Follow -------------------------// Err err; UInt16 portId; //-----------------------------------------------------------------------// //----------------------------- Internal Constants ----------------------// #define appFileCreator 'STRT' #define appVersionNum #define appPrefID #define appPrefVersionNum ...
Page 9
Freescale Semiconductor, Inc. switch (cmd) { case sysAppLaunchCmdNormalLaunch: error = AppStart(); if (error) return error; FrmGotoForm(MainForm); AppEventLoop(); AppStop(); break; default: break; } return errNone; } //-----------------------------------------------------------------------// //-----------------------------------------------------------------------// // Function: // Objective: // Get the current application's preferences. // Called by: ...
Page 10
Freescale Semiconductor, Inc. Program Source Code // Write the saved preferences / saved-state information. // will be backed up during a HotSync. PrefSetAppPreferences (appFileCreator, appPrefID, appPrefVersionNum, &prefs, sizeof (prefs), true); // Close all the open forms. SrmClose(portId); FrmCloseAllForms (); } ...
Page 11
Freescale Semiconductor, Inc. case MainForm: FrmSetEventHandler(frmP, MainFormHandleEvent); break; default: break; } return true; } return false; } //-----------------------------------------------------------------------// //-----------------------------------------------------------------------// // Function : MainFormHandleEvent // Objective: // This function is the event handler for the MainForm of // this application. // ...
Page 12
Freescale Semiconductor, Inc. Program Source Code //-----------------------------------------------------------------------// // Function : MainFormButtonHandler // Objective: // This function processes the events generated by the buttons on// // the MainForm when they are pressed. // Called by: // This function is called by ...
Page 13
Freescale Semiconductor, Inc. case MainPhoneOffHookGraphicButton:// Key "Talk" SrmSend(portId, &Talk, StrLen(Talk), &err); break; case MainKeyZeroButton: SrmSend(portId, &NumZero,StrLen(NumZero), &err); break; case MainKeyOneButton: SrmSend(portId, &NumOne, StrLen(NumOne), &err); break; case MainKeyTwoButton: SrmSend(portId, &NumTwo, StrLen(NumTwo), &err); break; case MainKeyThreeButton:// Key #3 SrmSend(portId, &NumThree, StrLen(NumThree), &err); ...
Page 14
Freescale Semiconductor, Inc. Program Source Code SysTaskDelay(TxDelay); SndPlaySystemSound(7 >> "AT+CGDCONT=1,." SrmSend(portId, &GprsInitMsgFour, SysTaskDelay(TxDelay); SndPlaySystemSound(7 >> "AT+CGQREQ=..." SrmSend(portId, &GprsInitMsgFive, SysTaskDelay(TxDelay); SndPlaySystemSound(7 >> "AT+CGQMIN=..." SrmSend(portId, &GprsInitMsgSix, SysTaskDelay(TxDelay); SndPlaySystemSound(7 >> "ATE0" SrmSend(portId, &GprsInitMsgThree, SysTaskDelay(TxDelay); SndPlaySystemSound(7); ...
Page 15
Freescale Semiconductor, Inc. //-----------------------------------------------------------------------// // Function : MainFormInit // Objective: // This function initializes the MainForm form. // Called by: // MainFormHandleEvent() //-----------------------------------------------------------------------// static void MainFormInit(FormPtr //-----------------------------------------------------------------------// //-----------------------------------------------------------------------// // Function : MainFormDoCommand // Objective: // This function performs ...
Page 16
Freescale Semiconductor, Inc. Setting Up and Running the Application //-----------------------------------------------------------------------// // Function : RomVersionCompatible // Objective: // This routine checks that a ROM version meets the // minimum requirement. // Called by: // StarterPalmMain() //-----------------------------------------------------------------------// static Err RomVersionCompatible(UInt32 requiredVersion, UInt16 ...
Page 17
Freescale Semiconductor, Inc. 5.1 Loading the Program The following program files should be loaded to the PDA: • Eudora.prc • Eudora_Web.prc • GPRS.prc These files can loaded using the HotSync operation or by any other means (such as IR beaming ...
Page 18
Freescale Semiconductor, Inc. Guidelines for Porting 5.3.1 Initiating a GSM Call Click on the numeric buttons in the sequence of the number to be dialed. When a numeric button is clicked, the corresponding number appears on the mobile phone’s screen. ...
Page 19
Freescale Semiconductor, Inc. In place of Metrowerks CodeWarrior for Palm OS, use a development tool designed for the target operating system. 7 Summary GSM-GPRS is an application to automate GPRS-based Internet access on mobile PDA. The application uses a simple ...
Page 20
... Motorola and the Stylized M Logo are registered in the U.S. Patent and Trademark Office. All other product or service names are the property of their respective owners. Motorola, Inc Equal Opportunity/Affirmative Action Employer. © Motorola, Inc. 2002 AN2385/D For More Information On This Product, Go to: www.freescale.com ...