5 #include <ATcodec/ATcodec_api.h>
6 #include <VP_Stages/vp_stages_io_com.h>
8 #define AT_MESSAGES_HEADER "ATcodec/ATcodec_Messages_ex.h"
10 #include "ATcodec/ATcodec_api.h"
11 #include "VP_Os/vp_os_types.h"
12 #include "VP_Os/vp_os_thread.h"
13 #include "VP_Os/vp_os_delay.h"
14 #include "VP_Os/vp_os_print.h"
15 #include <Examples/common/atcodec_client.h>
17 #ifndef AT_MESSAGES_HEADER
18 #error You need to define AT_MESSAGES_HEADER
21 extern AT_CODEC_MSG_IDS ids;
23 #define INTRA_CMD_DELAY 10
26 thread_send_commands (THREAD_PARAMS data)
30 ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_CGMI);
31 vp_os_delay(INTRA_CMD_DELAY);
32 ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_CGMI);
33 vp_os_delay(INTRA_CMD_DELAY);
34 //vp_os_thread_yield();
36 ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_QW,1);
37 vp_os_delay(INTRA_CMD_DELAY);
38 ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_QW,1);
39 vp_os_delay(INTRA_CMD_DELAY);
40 //vp_os_thread_yield();
42 ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_EXE,1,50);
43 vp_os_delay(INTRA_CMD_DELAY);
44 ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_EXE,1,50);
45 vp_os_delay(INTRA_CMD_DELAY);
46 //vp_os_thread_yield();
50 int main(int argc, char **argv)
52 THREAD_HANDLE atcodec_test_handle;
53 THREAD_HANDLE atcodec_test_handle2;
54 THREAD_HANDLE cmds_handle;
56 AT_CODEC_FUNCTIONS_PTRS ptrs =
58 .init = AT_CODEC_Client_init,
59 .shutdown = AT_CODEC_Client_shutdown,
60 .open = AT_CODEC_Client_open,
61 .close = AT_CODEC_Client_close,
62 .read = AT_CODEC_Client_read,
63 .write = AT_CODEC_Client_write,
66 ATcodec_Init_Library(&ptrs);
68 vp_os_thread_create(thread_ATcodec_Commands_Client, 0, &atcodec_test_handle);
69 vp_os_thread_create(thread_send_commands, 0, &cmds_handle);
70 vp_os_thread_create(thread_ATcodec_Commands_Server, 0, &atcodec_test_handle2);
72 vp_os_thread_join(cmds_handle);
73 vp_os_thread_join(atcodec_test_handle2);
74 vp_os_thread_join(atcodec_test_handle);