#include "at_tool.h" | |
static void at_progess(int argc, char *argv[]) | |
{ | |
int ret = -1; | |
char send_at_buf[128] = {0}; | |
char *pstr = malloc(128); | |
memset(pstr, 0, 128); | |
if(argv[1] != NULL && strlen(argv[1]) >= 2 && strncasecmp(argv[1], "at", 2) == 0) | |
{ | |
sprintf(send_at_buf, "%s\r", argv[1]); | |
ret = get_modem_info(send_at_buf, "%s", (void**)&pstr); | |
if(0 == ret) | |
{ | |
printf("%s\n", pstr); | |
} | |
else | |
{ | |
printf("AT command error\n"); | |
} | |
} | |
else | |
{ | |
printf("not a valid AT command: error\n"); | |
} | |
free(pstr); | |
return; | |
} | |
int main(int argc, char *argv[]) | |
{ | |
if(argc > 1) | |
{ | |
at_progess(argc, argv); | |
} | |
return 0; | |
} |