rk3568_ubuntu_r60_v1.3.2/external/quectel-app/ql-misc-test/auto_sendcmd.c

35 lines
874 B
C
Raw Normal View History

2023-11-03 14:12:44 +08:00
/**
* Copyright: (C) 2020 Quectel
* All rights reserved.
* Filename: send-at-tool.c
* Description: QL_MISC_SendAT() API example
* Version: 1.0.0(20200917)
* Author: Peeta Chen <peeta.chen@quectel.com>
* ChangeLog: 1, Release initial version on "2020年09月17日 16时00分18秒"
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ql_misc.h>
int main (int argc, char **argv)
{
int ret = 0;
char cmd_resp[1024] = {0};
if(argc != 2) {
printf ("command number error\n");
return -1;
}
memset(cmd_resp, 0, sizeof(cmd_resp));
ret = QL_MISC_SendAT(argv[1], cmd_resp, sizeof(cmd_resp));
if (ret <= 0)
printf ("QL_MISC_SendAT failed with return:%d\n", ret);
else
printf ("%s\n", cmd_resp);
return 0;
} /* ----- End of main() ----- */