当前位置: 技术问答>linux和unix
在linux下用c语言编写短信数据查询系统
来源: 互联网 发布时间:2015-09-15
本文导语: 在linux下用c语言编写短信数据查询系统,对mysql数据库查询处理,请求高手指点!最好有c的代码!高分求助,感激不尽! | /* * 初始化 gsm modem * * Author : Tengulre * CreateTime: 2004/04/12 * */ vo...
在linux下用c语言编写短信数据查询系统,对mysql数据库查询处理,请求高手指点!最好有c的代码!高分求助,感激不尽!
|
/*
* 初始化 gsm modem
*
* Author : Tengulre
* CreateTime: 2004/04/12
*
*/
void initmodem()
{
char command[100];
char answer[500];
int retries=0;
int success=0;
if (! quickinit)
{
writelogfile(LOG_INFO,"Checking if modem is ready");
retries=0;
do
{
retries++;
put_command("x1Ar",answer,sizeof(answer),5,0);
put_command("ATr",answer,sizeof(answer),50,"OK");
if (strstr(answer,"OK"))
writelogfile(LOG_INFO,"Modem is ready");
else
writelogfile(LOG_NOTICE,"Modem is not ready, retry");
}
while ((retries
* 初始化 gsm modem
*
* Author : Tengulre
* CreateTime: 2004/04/12
*
*/
void initmodem()
{
char command[100];
char answer[500];
int retries=0;
int success=0;
if (! quickinit)
{
writelogfile(LOG_INFO,"Checking if modem is ready");
retries=0;
do
{
retries++;
put_command("x1Ar",answer,sizeof(answer),5,0);
put_command("ATr",answer,sizeof(answer),50,"OK");
if (strstr(answer,"OK"))
writelogfile(LOG_INFO,"Modem is ready");
else
writelogfile(LOG_NOTICE,"Modem is not ready, retry");
}
while ((retries