gprstst.cpp
来自「一个PPP上网协议源码,可通过GPRS网络接入因特网.」· C++ 代码 · 共 45 行
CPP
45 行
/*//////////////////////////////////////////////////////////////////////////
Description: The program executes the necessary operations to make
the ETR232i, including GPRS module, connecting to internet.
//////////////////////////////////////////////////////////////////////////*/
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include "etr_ppp.h"
#include "GPRS.h"
int main( )
{
int i1, i2;
unsigned char OwnIPStr[20];
PPPGPRSState PPPState;
printf( "GPRS Test Demo V1.0\n" );
for( i1=0, i2=-1; ; )
{
PPPState = PPP_Running( );
if( PPPState!=PPPLINKUP )
{
i1 = 0;
if( PPPState != i2 )
{
printf( "RIdx=%d ", PPPState );
i2 = PPPState;
}
continue;
}
if( i1==0 )
{
GetOWNIP( OwnIPStr );
printf( "\nIP=%d.%d.%d.%d\n", OwnIPStr[0], OwnIPStr[1], OwnIPStr[2], OwnIPStr[3] );
i1 = 1;
}
if( kbhit( ) ) { getch(); break; }
}
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?