clockfrane process add dbus msg handle
This commit is contained in:
parent
9911f975e2
commit
6e51825c8d
|
@ -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)" \
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <uv.h>
|
||||
#include <dbus/dbus.h>
|
||||
#include <errno.h>
|
||||
#include <cjson/s2j.h>
|
||||
|
||||
#include <uvdbus/log.h>
|
||||
#include <uvdbus/libuv_dbus.h>
|
||||
#include <uvdbus/crypto.h>
|
||||
#include <uvdbus/json_struct.h>
|
||||
#include <uvdbus/config_engine.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <thread>
|
||||
#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);
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit ae6b247e60a3a17c6fbbc60a2a47f71c58757f5f
|
||||
Subproject commit 936bfe741da4840da0ced51a22dd619ece604835
|
Loading…
Reference in New Issue