[Feature]add MT2731_MP2_MR2_SVN388 baseline version
Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/src/lynq/packages/apps/lynq-udpser/lynq_udpser.c b/src/lynq/packages/apps/lynq-udpser/lynq_udpser.c
new file mode 100644
index 0000000..fba98b0
--- /dev/null
+++ b/src/lynq/packages/apps/lynq-udpser/lynq_udpser.c
@@ -0,0 +1,56 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <strings.h>
+#include "liblog/liblog.h"
+#include "liblog/lynq_deflog.h"
+
+#define USER_LOG_TAG "UDPSER"
+#define BUF_LEN 128
+#define ERR_SOCK 3
+#define SA struct sockaddr
+
+int main(int argc, const char *argv[])
+{
+ int sockfd;
+ char buf[128];
+
+ LYLOGEINIT(USER_LOG_TAG);
+ sockfd=socket(AF_INET,SOCK_DGRAM,0);
+
+ if(sockfd<0)
+ {
+ LYDBGLOG("fail to sockfd\n");
+ return -1;
+ }
+
+ struct sockaddr_in seraddr,peeraddr;
+ seraddr.sin_family=AF_INET;
+ seraddr.sin_port=htons(50000);
+
+ seraddr.sin_addr.s_addr=inet_addr("0.0.0.0");
+
+ int ret_bind;
+ ret_bind=bind(sockfd,(struct sockaddr *)&seraddr,sizeof(seraddr));
+
+ if(ret_bind<0)
+ {
+ LYDBGLOG("fail to bind\n");
+ return -1;
+ }
+
+ int len=sizeof(peeraddr);
+
+ while(1)
+ {
+ bzero(buf,sizeof(buf));
+
+ recvfrom(sockfd,buf,sizeof(buf),0,(struct sockaddr*)&peeraddr,&len);
+
+ LYVERBLOG("+[udpser]: ser_rcv = %s\n", buf);
+ sendto(sockfd,buf,sizeof(buf),0,(SA *)&peeraddr,len);
+ }
+ return 0;
+}
diff --git a/src/lynq/packages/apps/lynq-udpser/makefile b/src/lynq/packages/apps/lynq-udpser/makefile
new file mode 100644
index 0000000..06cf753
--- /dev/null
+++ b/src/lynq/packages/apps/lynq-udpser/makefile
@@ -0,0 +1,50 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+ -g -Os \
+ -flto \
+ -fpermissive \
+
+
+
+
+LOCAL_PATH = .
+
+LOCAL_C_INCLUDES = \
+ -I. \
+ -I$(ROOT)$(includedir)/logger \
+ -I$(ROOT)$(includedir)/liblog \
+ -I$(ROOT)$(includedir)/glib-2.0 \
+ -I$(ROOT)$(libdir)/glib-2.0/include \
+ -I$(ROOT)$(includedir)/dbus-1.0 \
+ -I$(ROOT)$(libdir)/dbus-1.0/include \
+
+
+LOCAL_LIBS := \
+ -L. \
+ -ldl \
+ -lpthread \
+ -llynq-log \
+ -lssl \
+ -lglib-2.0 \
+ -lgobject-2.0 \
+ -lgio-2.0 \
+ -ldbus-1 \
+
+SOURCES = $(wildcard *.c)
+
+EXECUTABLE = lynq-udpser
+
+OBJECTS=$(SOURCES:.c=.o)
+all: $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CXX) $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
+
+%.o : %.c
+ $(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
+
+.PHONY: clean
+clean:
+ $(RM) $(OBJECTS) $(EXECUTABLE)