From 6e51825c8dd32fe3c4577b455cf65ea9523fee9a Mon Sep 17 00:00:00 2001 From: lupeng Date: Wed, 23 Jan 2019 13:35:20 +0800 Subject: [PATCH] clockfrane process add dbus msg handle --- package/netease/clockFrame/Makefile | 11 ++-- package/netease/clockFrame/src/main.cpp | 71 +++++++++++++++++++++++++ package/netease/submodules | 2 +- 3 files changed, 80 insertions(+), 4 deletions(-) create mode 100755 package/netease/clockFrame/src/main.cpp diff --git a/package/netease/clockFrame/Makefile b/package/netease/clockFrame/Makefile index c99023a9d..a3e214d63 100755 --- a/package/netease/clockFrame/Makefile +++ b/package/netease/clockFrame/Makefile @@ -1,5 +1,6 @@ include $(TOPDIR)/rules.mk include $(BUILD_DIR)/kernel.mk +include $(TINA_BUILD_TOP)/package/netease/Makefile.common PKG_NAME:=democlock PKG_VERSION:=1 @@ -24,7 +25,9 @@ define Package/$(PKG_NAME) SECTION:=utils CATEGORY:=Netease TITLE:=$(PKG_NAME) app - DEPENDS:=+qt5-gui +qt5-core +qt5-widgets +qt5-network +qt5-qml +qt5-quick +qt5-graphicaleffects +qt5-quick-2 +qt5-quick-controls +qt5-quick-layouts +qt5-quick-controls-2 +qt5-virtual-keyboard + DEPENDS:=+qt5-gui +qt5-core +qt5-widgets +qt5-network +qt5-qml +qt5-quick +qt5-graphicaleffects \ + +qt5-quick-2 +qt5-quick-controls +qt5-quick-layouts +qt5-quick-controls-2 +qt5-virtual-keyboard \ + $(MAKE_COMMON_DEPEND) endef define Package/$(PKG_NAME)/description @@ -36,6 +39,8 @@ define Build/Prepare sh ./clockFrameCodePull.sh mkdir -p $(PKG_BUILD_DIR) $(CP) -r ./C1-windows/Frames/* $(PKG_BUILD_DIR)/ + rm -rf $(PKG_BUILD_DIR)/main.cpp + $(CP) -r ./src/* $(PKG_BUILD_DIR)/ $(CP) clockFrameQt.sh $(PKG_BUILD_DIR)/clockFrame endef @@ -47,7 +52,7 @@ define Build/Configure TARGET_RANLIB="$(TARGET_CROSS)ranlib" \ TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ - TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) $(BUILD_COMMON_LIB)" \ TARGET_INCDIRS="$(TARGET_INCDIRS)" \ TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \ TARGET_LIBS="$(TARGET_LIBS)" \ @@ -68,7 +73,7 @@ define Build/Compile TARGET_RANLIB="$(TARGET_CROSS)ranlib" \ TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ - TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) $(BUILD_COMMON_LIB)" \ TARGET_INCDIRS="$(TARGET_INCDIRS)" \ TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \ TARGET_LIBS="$(TARGET_LIBS)" \ diff --git a/package/netease/clockFrame/src/main.cpp b/package/netease/clockFrame/src/main.cpp new file mode 100755 index 000000000..6bbd3586f --- /dev/null +++ b/package/netease/clockFrame/src/main.cpp @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "include/democlock.h" + +static std::thread thdDbusLoop; +static const char* g_pDBusInterfaceName = NULL; + +PDBUS_MSG_PACK DBusOnMessage(uv_loop_t *pLoop, DBusConnection *pConn,PDBUS_MSG_PACK pMsg) { + + + if(pMsg->busCmd != 0xa0a) + LOG_EX(LOG_Debug, "Frame module get message cmd:0x%x\r\n",pMsg->busCmd); + if (!pMsg || !pLoop || !pConn) { + return NULL; + } + + switch (pMsg->busCmd) { + //case CMD_SPLAYER_SFIFO_TEST: + // break; + default: + break; + } + +} + +int main(int argc, char *argv[]) +{ + int ret = 0; + DBusConnection* pBus = NULL; + uv_loop_t* pLoop = uv_default_loop(); + + g_pDBusInterfaceName = g_pModInfoTable[MODULE_CLOCK_FRAME].modAliase; + + + LOG_EX(LOG_Debug, "\r\nStart the clockFrame communocation,module number is %d\r\n",MODULE_CLOCK_FRAME); + + + pBus = DBusWithLibuvInit(pLoop, g_pDBusInterfaceName, DBusOnMessage, NULL, NULL, &ret); + + if(pBus == NULL) + { + fprintf(stderr, "%s(%d): DBusWithLibuvInit Error: %d\n", g_pDBusInterfaceName, MODULE_CLOCK_FRAME, ret); + return 0; + } + + thdDbusLoop = std::thread(RunUVLoop, pLoop); + thdDbusLoop.detach(); + + return frameShow(argc, argv); +} \ No newline at end of file diff --git a/package/netease/submodules b/package/netease/submodules index ae6b247e6..936bfe741 160000 --- a/package/netease/submodules +++ b/package/netease/submodules @@ -1 +1 @@ -Subproject commit ae6b247e60a3a17c6fbbc60a2a47f71c58757f5f +Subproject commit 936bfe741da4840da0ced51a22dd619ece604835