📄 gprs.c
字号:
case MainInitGprsNetGraphicButton: // Key "GPRS_Init"
SrmSend(portId, &GprsInitMsgOne, 2, &err); // Tx >> "AT"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgOne, 2, &err); // Tx >> "AT"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgOne, 2, &err); // Tx >> "AT"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgTwo, 9, &err); // Tx >> "AT+CGATT?"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgThree, 4, &err); // Tx >> "ATE0"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgFourA, 13, &err); // Tx >> "AT+CGDCONT=1,"
SrmSend(portId, &DbleCot, 1, &err); // Tx >> ["]
SrmSend(portId, &GprsInitMsgFourB, 2, &err); // Tx >> "IP"
SrmSend(portId, &DbleCot, 1, &err); // Tx >> ["]
SrmSend(portId, &Comma, 1, &err); // Tx >> ","
SrmSend(portId, &DbleCot, 1, &err); // Tx >> ["]
SrmSend(portId, &GprsInitMsgFourC, 25, &err); // Tx >> "internet2.voi..."
SrmSend(portId, &DbleCot, 1, &err); // Tx >> ["]
SrmSend(portId, &GprsInitMsgFourD, 5, &err); // Tx >> ",,0,0"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgFive, 21, &err); // Tx >> "AT+CGQREQ=..."
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgSix, 21, &err); // Tx >> "AT+CGQMIN=..."
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgSeven, 12, &err); // Tx >> "AT+IPR=57600"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgEight, 3, &err); // Tx >> "ATZ"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgNine, 6, &err); // Tx >> "ATE1V1"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgTen, 10, &err); // Tx >> "AT+IFC=2,2"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgEleven, 6, &err); // Tx >> "ATS0=0"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgEight, 3, &err); // Tx >> "ATZ"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgNine, 6, &err); // Tx >> "ATE1V1"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmSend(portId, &GprsInitMsgTen, 10, &err); // Tx >> "AT+IFC=2,2"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
/*
SrmSend(portId, &Dial, 7, &err); // Tx >> "ATD*99#"
SrmSend(portId, &CarrRet, 2, &err);
SysTaskDelay(TxDelay);
SndPlaySystemSound(7);
SrmClose(portId);
SndPlaySystemSound(7); */
//----- Programmatically launching Eudora Browser now.
//----- This functionality added on 17-Jan-2001.
err = DmGetNextDatabaseByTypeCreator (true, &SearchState, sysFileTApplication, extAppEudoraWeb,
true, &cardNo, &dbID);
Eud = MemPtrNew(StrLen(url)+1);
MemPtrSetOwner(Eud,0);
err = SysUIAppSwitch (cardNo, dbID,sysAppLaunchCmdNormalLaunch, Eud);
break;
}
handled = true;
return handled;
}
//
//
//---------------------------------------------------------------------------//
//-----------------------------------------------------------------------------//
// //
// Function : MainFormInit //
// //
// //
// Objective: //
// This function initializes the MainForm form. //
// Called by: //
// MainFormHandleEvent() //
// //
// Parameters: frm - pointer to the MainForm form. //
// Returned: Nothing. //
// History: First created on Jan-12-2002. //
// //
//-----------------------------------------------------------------------------//
//
//
//
static void MainFormInit(FormPtr)
{
}
//
//
//
//-----------------------------------------------------------------------------//
//-----------------------------------------------------------------------------//
// //
// Function : MainFormDoCommand //
// //
// //
// Objective: //
// This function performs the menu command specified. //
// Called by: //
// MainFormHandleEvent() //
// //
// Parameters: frm - pointer to the MainForm form. //
// Returned: Nothing. //
// History: First created on Jan-12-2002. //
// //
//-----------------------------------------------------------------------------//
//
//
//
static Boolean MainFormDoCommand(UInt16 command)
{
Boolean handled = false;
FormPtr frmP;
switch (command)
{
case MainOptionsAboutStarterApp:
MenuEraseStatus(0); // Clear the menu status from the display.
frmP = FrmInitForm (AboutForm);
FrmDoDialog (frmP); // Display the About Box.
FrmDeleteForm (frmP);
handled = true;
break;
}
return handled;
}
//
//
//
//-----------------------------------------------------------------------------//
//-----------------------------------------------------------------------------//
// //
// Function : GetObjectPtr //
// //
// //
// Objective: //
// This routine returns a pointer to an object in the current //
// form. //
// Called by: //
// //
// //
// Parameters: formID - id of the form to display. //
// Returned: Nothing. //
// History: First created on Jan-12-2002. //
// //
//-----------------------------------------------------------------------------//
//
//
//
static void * GetObjectPtr(UInt16 objectID)
{
FormPtr frmP;
frmP = FrmGetActiveForm();
return FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, objectID));
}
//
//
//
//-----------------------------------------------------------------------------//
//-----------------------------------------------------------------------------//
// //
// Function : RomVersionCompatible //
// //
// //
// Objective: //
// This routine checks that a ROM version meets the //
// minimum requirement. // //
// Called by: //
// StarterPalmMain() //
// //
// Parameters: requiredVersion - minimum rom version required //
// (see sysFtrNumROMVersion in SystemMgr.h //
// for format) //
// launchFlags - flags that indicate if the application //
// UI is initialized. //
// Returned: error code or zero if rom is compatible //
// History: First created on Jan-12-2002. //
// //
//-----------------------------------------------------------------------------//
//
//
//
static Err RomVersionCompatible(UInt32 requiredVersion, UInt16 launchFlags)
{
UInt32 romVersion;
// See if we're on in minimum required version of the ROM or later.
FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion);
if (romVersion < requiredVersion)
{
if ((launchFlags & (sysAppLaunchFlagNewGlobals | sysAppLaunchFlagUIApp)) ==
(sysAppLaunchFlagNewGlobals | sysAppLaunchFlagUIApp))
{
FrmAlert (RomIncompatibleAlert);
// Palm OS 1.0 will continuously relaunch this app unless we switch to
// another safe one.
if (romVersion < ourMinVersion)
{
AppLaunchWithCommand(sysFileCDefaultApp, sysAppLaunchCmdNormalLaunch, NULL);
}
}
return sysErrRomIncompatible;
}
return errNone;
}
//
//
//
//-----------------------------------------------------------------------------//
//------------------------------------ End of File ----------------------------//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -