diff options
author | ZoRo <dos21h@gmail.com> | 2017-02-08 22:39:58 +0000 |
---|---|---|
committer | ZoRo <dos21h@gmail.com> | 2017-02-08 22:39:58 +0000 |
commit | abfd02fc7233734ffcc3c396efcbedddfba49727 (patch) | |
tree | fdc01c94c36aa93967f09f53b5a72f3b8d4bf074 /agni.c | |
parent | 0397a4c9dee0300e0ee843fe85aa4c2d77630758 (diff) | |
download | agni-abfd02fc7233734ffcc3c396efcbedddfba49727.tar.gz agni-abfd02fc7233734ffcc3c396efcbedddfba49727.zip |
Updated command parser. Event loop now support test commands
Diffstat (limited to 'agni.c')
-rw-r--r-- | agni.c | 29 |
1 files changed, 26 insertions, 3 deletions
@@ -664,7 +664,7 @@ int th_event_manager(void *data) int err; int mq_event; //read any command - //mq_cmd *cmd = NULL; + mq_cmd *recv_cmd = NULL; // for recieved cmd from mq struct mq_attr out_attr, *ptr_out_attr=&out_attr; printf("Start event thread\n"); @@ -714,12 +714,35 @@ int th_event_manager(void *data) //if (run == 10) // break; - //applay to recieved command executor //if QUIT then quit the thread + recv_cmd = mq_cmd_creates(out_buf, out_attr.mq_msgsize, -1); + if (recv_cmd != NULL) + { + PNL(); + if (mq_cmd_o_cmp_cmd(recv_cmd,"QUIT") == 0) + { + printf("QUIT recieved lets quit main loop\n"); + break; + } + + if (mq_cmd_o_cmp_cmd(recv_cmd,"CMD1") == 0) + { + printf("Hey dude it works\n"); + } + + if (mq_cmd_o_cmp_cmd(recv_cmd,"CMD2") == 0) + { + printf("Hey dude it works second time\n"); + } + + } + + //applay to recieved command executor + //other command pass to cmd/execution matching table //pass to exec handler //get response if command is immidieate otherwise wait for response in next execution - + } free(out_buf); |