Commit fd7a0c6b authored by whmaizmy's avatar whmaizmy Committed by 黄振令

Author: huang.zhenling

Root Cause:添加midware 应用
How2Fix:
parent 56cc6d14
......@@ -11,13 +11,12 @@ COMP_LIB_COMPONENTS := \
src/test \
SUBDIRS += src/kcloud
SUBDIRS += src/midware
SUBDIRS += common/mqtt
SUBDIRS += common/json
SUBDIRS += common/api
#SUBDIRS += example/mqtt
SUBDIRS += example/nanomsg
SUBDIRS += example/ev
#SUBDIRS += example/ev_nanomsg
SUBDIRS += common/nanomsg
SUBDIRS += common/ev
$(call Append_Conditional, SUBDIRS)
......
LIBA_TARGET := libiot_kcloud.a
SRCS_kcloud := kcloud_main.c
$(call Append_Conditional, LIB_SRCS_EXCLUDE, kcloud_main.c)
$(call Append_Conditional, SRCS_kcloud, kcloud_main.c)
$(call Append_Conditional, TARGET, kcloud)
CFLAGS += -I$(TOP_DIR)/common/nanomsg/include
CFLAGS += -I$(TOP_DIR)/common/ev/include
CFLAGS += -I$(TOP_DIR)/common/json
LDFLAGS += -L$(TOP_DIR)/common/nanomsg -static -lnanomsg
LDFLAGS += -L$(TOP_DIR)/common/ev -static -lev
LDFLAGS += -liot_cjson -liot_mqtt -ldl -lm -lanl -liot_sdk
\ No newline at end of file
LIBA_TARGET := libmid_test.a
$(call Append_Conditional, LIB_SRCS_EXCLUDE, midware.c)
$(call Append_Conditional, SRCS_midware, midware.c)
$(call Append_Conditional, TARGET, midware)
LDFLAGS += -L$(TOP_DIR)/output/release/lib -static -lapi_com
#LDFLAGS += -L$(TOP_DIR)/common/api -static -lev -lnanomsg -ldl
CFLAGS += -I$(TOP_DIR)/common/nanomsg/include
CFLAGS += -I$(TOP_DIR)/common/ev/include
CFLAGS += -I$(TOP_DIR)/common/api
LDFLAGS += -L$(TOP_DIR)/common/nanomsg -static -lnanomsg -lanl
LDFLAGS += -L$(TOP_DIR)/common/ev -static -lev
LDFLAGS += -lapi_com
\ No newline at end of file
#include<stdio.h>
#include"com_api.h"
void mid_cb(void* data){
if (data != NULL){
printf("mid_cb: %s RECEIVED \r\n", data);
}
}
int main(const int argc, const char **argv)
{
/*if ((argc > 1) && (strcmp(NODE0, argv[1]) == 0))
return (node0(argv[2]));
if ((argc > 1) && (strcmp(NODE1, argv[1]) == 0))
return (node1(argv[2]));
fprintf(stderr, "Usage: pair %s|%s <URL> <ARG> ...\n", NODE0, NODE1);
return 1;*/
kk_ipc_init(IPC_MID2APP, mid_cb);
//printf("node0 111\r\n");
for (;;) {
//printf("node0 222\r\n");
sleep(5);
//printf("node0 3333\r\n");
kk_ipc_send("middleWare data to app!");
//printf("node0 4444\r\n");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment