aboutsummaryrefslogtreecommitdiffstats
path: root/agni.c
diff options
context:
space:
mode:
authorZoRo <dos21h@gmail.com>2017-02-08 22:39:58 +0000
committerZoRo <dos21h@gmail.com>2017-02-08 22:39:58 +0000
commitabfd02fc7233734ffcc3c396efcbedddfba49727 (patch)
treefdc01c94c36aa93967f09f53b5a72f3b8d4bf074 /agni.c
parent0397a4c9dee0300e0ee843fe85aa4c2d77630758 (diff)
downloadagni-abfd02fc7233734ffcc3c396efcbedddfba49727.tar.gz
agni-abfd02fc7233734ffcc3c396efcbedddfba49727.zip
Updated command parser. Event loop now support test commands
Diffstat (limited to 'agni.c')
-rw-r--r--agni.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/agni.c b/agni.c
index 32b3e12..ba35505 100644
--- a/agni.c
+++ b/agni.c
@@ -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);