liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | |
| 3 | #include "mbtk_at.h" |
| 4 | |
| 5 | #define LOGE printf |
| 6 | #define LOGI printf |
| 7 | |
| 8 | int main(int argc, char *argv[]) |
| 9 | { |
| 10 | if(argc != 2) { |
| 11 | LOGE("./at_test at_cmd\n"); |
| 12 | return -1; |
| 13 | } |
| 14 | |
| 15 | if(mbtk_at_init()) { |
| 16 | LOGE("mbtk_at_init() fail.\n"); |
| 17 | return -1; |
| 18 | } |
| 19 | |
| 20 | char at_rsp[2048]; |
| 21 | if(!mbtk_at_send(argv[1], at_rsp, 2048)) { |
| 22 | LOGI("%s", at_rsp); |
| 23 | } else { |
| 24 | LOGE("mbtk_at_send() fail.\n"); |
| 25 | } |
| 26 | |
| 27 | if(mbtk_at_deinit()) { |
| 28 | LOGE("mbtk_at_deinit() fail.\n"); |
| 29 | return -1; |
| 30 | } |
| 31 | |
| 32 | return 0; |
| 33 | } |