Change test makefile.

Change-Id: I27eef2cdb86b220dd03e9be79d5bef7f9303258b
diff --git a/mbtk/test/libmbtk_coap/Makefile b/mbtk/test/libmbtk_coap/Makefile
new file mode 100755
index 0000000..28bf46c
--- /dev/null
+++ b/mbtk/test/libmbtk_coap/Makefile
@@ -0,0 +1,34 @@
+ROOT = $(shell pwd)/../../..
+include $(ROOT)/mbtk/Make.defines
+
+INC_DIR +=
+
+LIB_DIR +=
+
+LIBS += -lmbtk_lib -lmbtk_net -lmbtk_coap
+
+CFLAGS += 
+
+DEFINE +=
+
+LOCAL_SRC_FILES = $(wildcard *.c) $(wildcard *.cpp)
+
+$(info LOCAL_SRC_FILES = $(LOCAL_SRC_FILES))
+
+OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(LOCAL_SRC_FILES)))
+BINS = $(patsubst %.o,%,$(OBJS))
+
+all: $(BINS)
+
+$(BINS):$(OBJS)
+	@echo "  BIN     $@"
+	$(CC) $(CFLAGS) $(LIB_DIR) $(LIBS) $@.o -o $(OUT_DIR)/bin/$@
+
+%.o:%.c
+	$(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
+
+%.o:%.cpp
+	$(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
+
+clean:
+	rm -f $(OBJS)
diff --git a/mbtk/test/libmbtk_coap/mbtk_coap_test.c b/mbtk/test/libmbtk_coap/mbtk_coap_test.c
new file mode 100755
index 0000000..4159a34
--- /dev/null
+++ b/mbtk/test/libmbtk_coap/mbtk_coap_test.c
@@ -0,0 +1,53 @@
+#include <string.h>
+#include "mbtk_type.h"
+#include "ql/ql_vcall.h"
+#include "mbtk_coap.h"
+#include "mbtk_coap_api.h"
+
+int coap_get_method(void);
+
+int coap_post_method(void);
+
+
+int main(int argc, char *argv[])
+{
+    char operator[10];
+    int opt;
+    int    ret     = -1;
+
+	printf("coap_demo star\r\n");
+	coap_get_method();
+
+	sleep(20);
+	coap_post_method();
+
+    return 0;
+}
+
+
+int coap_get_method(void)
+{
+	int ret = -1;
+	ret = mbtk_coap_ecoapnew_exec_cmd("134.102.218.18",5683,0,0);    //server ip, port
+	mbtk_coap_ecoapmsgid_exec_cmd(1);								//set message id
+	mbtk_coap_ecoaptype_exec_cmd(0);								//set message type
+	mbtk_coap_ecoapcode_exec_cmd(1);								//set Get request method
+	mbtk_coap_ecoapopt_exec_cmd("b474657374",10);					//set option
+
+	mbtk_coap_ecoapsend_exec_cmd(1, 0, NULL);						//request Get
+	return 0;
+}
+
+
+int coap_post_method(void)
+{
+	int ret = -1;
+	ret = mbtk_coap_ecoapnew_exec_cmd("134.102.218.18",5683,0,0);     //server ip, port
+	mbtk_coap_ecoapmsgid_exec_cmd(3);            					//set message id
+	mbtk_coap_ecoaptype_exec_cmd(0);             					//set message type
+	mbtk_coap_ecoapcode_exec_cmd(2);			 					//set Post request method
+	mbtk_coap_ecoapopt_exec_cmd("b474657374",10);					//set option
+
+	mbtk_coap_ecoapsend_exec_cmd(3, 7, "1111111");  				//request post
+	return 0;
+}