Skip to content

Commit

Permalink
fill some bits
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkie committed Dec 4, 2019
1 parent 7915bbb commit 8890bb4
Show file tree
Hide file tree
Showing 46 changed files with 445 additions and 33 deletions.
1 change: 1 addition & 0 deletions framework/libs/libeloop_mini
Submodule libeloop_mini added at 034ed0
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ static int logPort()
}

int RKDLog::mOutputFd = 1;
#ifdef ROKID_LOG_LEVEL
int RKDLog::mLevel = ROKID_LOG_LEVEL;
#else
int RKDLog::mLevel = RKDLog::DEFAULT;
#endif

std::mutex RKDLog::mMutex;
char RKDLog::mBuffer[LOG_SIZE];
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 14 additions & 1 deletion hardware/yodamk/android-hardware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,20 @@ define Package/android-hardware
SECTION:=libs
CATEGORY:=rokid
TITLE:=android-hardware
DEPENDS:=+libstdcpp +rklog +tinyalsa +android-system-core +libjson-c +libpthread +libusb-1.0 +wpa-supplicant +wpa_ctrl +libffmpeg-audio-dec +pulseaudio +PACKAGE_bsa_server:bsa_server +PACKAGE_vsp:vsp +PACKAGE_vsp_firmware:vsp_firmware +rklog
DEPENDS:=+libstdcpp \
+logging \
+tinyalsa \
+android-system-core \
+libjson-c \
+libpthread \
+libusb-1.0 \
+wpa-supplicant \
+wpa_ctrl \
+libffmpeg-audio-dec \
+pulseaudio \
+PACKAGE_bsa_server:bsa_server \
+PACKAGE_vsp:vsp \
+PACKAGE_vsp_firmware:vsp_firmware
endef

define Package/android-hardware/description
Expand Down
1 change: 0 additions & 1 deletion openwrt/package/yodaos/battery_service

This file was deleted.

53 changes: 53 additions & 0 deletions openwrt/package/yodaos/battery_service/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=battery_service
PKG_VERSION:=
PKG_RELEASE:=1

PKG_SOURCE_DIR:=$(ROKID_DIR)/framework/services/battery
PKG_FIXUP:=libtool
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0+

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/battery_service
SECTION:=libs
CATEGORY:=rokid
TITLE:=battery_service
DEPENDS:=+libstdcpp +libjson-c +android-hardware +PACKAGE_flora:flora +PACKAGE_flora:mutils
endef

define Package/battery_service/description
battery service
endef

define Build/Prepare
$(CP) $(PKG_SOURCE_DIR)/* $(PKG_BUILD_DIR)
$(call Build/Prepare/Default,)
endef

CMAKE_OPTIONS += \
-DCUSTOM_CMAKE_MODULES=${PKG_SOURCE_DIR}/../cmake-modules
CMAKE_FIND_ROOT_PATH := ${CMAKE_FIND_ROOT_PATH};${STAGING_DIR}

define Build/InstallDev
echo "Here is battery fileware Build/InstallDev"
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/src/battery_service $(1)/usr/bin/
endef

define Package/battery_service/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/src/battery_service $(1)/usr/bin/
$(CP) $(PKG_BUILD_DIR)/demo/bat_test $(1)/usr/bin/
$(CP) $(PKG_BUILD_DIR)/demo/bat_monitor $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d/
$(CP) ./bat_service $(1)/etc/init.d/
$(CP) ./batchg_poll $(1)/etc/init.d/
endef

$(eval $(call BuildPackage,battery_service))

27 changes: 27 additions & 0 deletions openwrt/package/yodaos/battery_service/batchg_poll
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh /etc/rc.common

START=90
USE_PROCD=1

chg_detect() {
CHG_FLAG=`getprop | grep "persist.sys.charger.mode" | awk '{print $2}'`
CHG_FLAG=${CHG_FLAG:1}
CHG_FLAG=${CHG_FLAG%?}

if [ "$CHG_FLAG" != "1" ]; then
echo "persist.sys.charger.mode is $CHG_FLAG" > /dev/console
else
while true; do
sleep 10
echo "Enter charging mode" > /dev/console
done
fi
}

start_service() {
procd_open_instance
procd_set_param stdout 1
procd_set_param stderr 1
chg_detect
procd_close_instance
}
17 changes: 17 additions & 0 deletions openwrt/package/yodaos/battery_service/battery_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2011 OpenWrt.org

START=89
USE_PROCD=1
PROG=/usr/bin/battery_service

start_service() {
mkdir /var/run/battery

procd_open_instance
procd_set_param command $PROG
procd_set_param respawn 3600 2 -1
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
1 change: 0 additions & 1 deletion openwrt/package/yodaos/bluetooth_service

This file was deleted.

15 changes: 15 additions & 0 deletions openwrt/package/yodaos/bluetooth_service/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
menu "bluetooth_service configs"

config BT_SERVICE_IPC_BY_FLORA
bool "Bluetooth ipc by flora"
default y

config BT_SERVICE_IPC_BY_ZEROMQ
bool "Bluetooth ipc by zeromq"
default n

config BT_SERVICE_HAVE_HFP
bool "Bluetooth service have hfp"
default n

endmenu
82 changes: 82 additions & 0 deletions openwrt/package/yodaos/bluetooth_service/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=bluetooth_service
PKG_VERSION:=
PKG_RELEASE:=1

PKG_SOURCE_DIR:=$(ROKID_DIR)/framework/services/bluetooth
PKG_FIXUP:=libtool
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0+

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/bluetooth_service
SECTION:=libs
CATEGORY:=yodaos
TITLE:=bluetooth_service
DEPENDS:=+libstdcpp \
+libjson-c \
+libffmpeg-audio-dec \
+android-hardware \
+libeloop_mini \
+PACKAGE_flora:flora \
+PACKAGE_flora:mutils \
+libopus \
+PACKAGE_gxopus:gxopus
endef

CMAKE_OPTIONS += -DBT_SERVICE_IPC_BY_FLORA=1

ifeq ($(CONFIG_PRODUCT_OS_NAME),"yodaos")
CMAKE_OPTIONS += -DROKID_YODAOS=1
endif

ifeq ($(CONFIG_BT_SERVICE_HAVE_HFP),y)
CMAKE_OPTIONS += -DBT_SERVICE_HAVE_HFP=1
endif

ifeq ($(CONFIG_TARGET_leo),y)
CMAKE_OPTIONS += -DBT_SERVICE_USE_K18_HW_OPUS=1
else
CMAKE_OPTIONS += -DBT_SERVICE_USE_SW_OPUS=1
endif

define Package/bluetooth_service/config
source "$(SOURCE)/Config.in"
endef

define Package/bluetooth_service/description
bluetooth service
endef

define Build/Prepare
$(CP) $(PKG_SOURCE_DIR)/* $(PKG_BUILD_DIR)
$(call Build/Prepare/Default,)
endef

CMAKE_OPTIONS += \
-DCUSTOM_CMAKE_MODULES=${PKG_SOURCE_DIR}/../cmake-modules
CMAKE_FIND_ROOT_PATH := ${CMAKE_FIND_ROOT_PATH};${STAGING_DIR}

define Build/InstallDev
echo "Here is bluetooth fileware Build/InstallDev"
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/src/bluetooth_service $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
endef

define Package/bluetooth_service/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/src/bluetooth_service $(1)/usr/bin/
$(CP) $(PKG_BUILD_DIR)/demo/bt_service_test $(1)/usr/bin/
$(CP) $(PKG_BUILD_DIR)/demo/bt_monitor $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d/
$(CP) ./bt_service $(1)/etc/init.d/
endef

$(eval $(call BuildPackage,bluetooth_service))

18 changes: 18 additions & 0 deletions openwrt/package/yodaos/bluetooth_service/bt_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2011 OpenWrt.org

START=89
USE_PROCD=1
PROG=/usr/bin/bluetooth_service

start_service() {
mkdir -p /var/run/bluetooth

procd_open_instance
procd_set_param command $PROG
procd_set_param respawn 3600 2 -1
procd_set_param stdout 1
procd_set_param stderr 1
# procd_set_param limits core="unlimited"
procd_close_instance
}
1 change: 0 additions & 1 deletion openwrt/package/yodaos/bsa_server

This file was deleted.

1 change: 0 additions & 1 deletion openwrt/package/yodaos/googletest

This file was deleted.

1 change: 0 additions & 1 deletion openwrt/package/yodaos/gsensor_service

This file was deleted.

1 change: 0 additions & 1 deletion openwrt/package/yodaos/httpdns

This file was deleted.

1 change: 0 additions & 1 deletion openwrt/package/yodaos/httpsession

This file was deleted.

41 changes: 41 additions & 0 deletions openwrt/package/yodaos/httpsession/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

include $(TOPDIR)/rules.mk

PKG_NAME:=httpsession
PKG_VERSION:=
PKG_RELEASE:=1

PKG_SOURCE_DIR:=$(ROKID_DIR)/framework/libs/httpsession
PKG_FIXUP:=libtool
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0+

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

PKG_INSTALL:=

define Package/httpsession
SECTION:=libs
CATEGORY:=rokid
TITLE:=httpsession
DEPENDS:=+libcurl +libstdcpp +libpthread
endef

define Build/Prepare
$(CP) $(PKG_SOURCE_DIR)/* $(PKG_BUILD_DIR)
endef

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/*.so $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include
endef

define Package/httpsession/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/*.so $(1)/usr/lib
endef

$(eval $(call BuildPackage,httpsession))
1 change: 0 additions & 1 deletion openwrt/package/yodaos/iot_autoconnect

This file was deleted.

1 change: 0 additions & 1 deletion openwrt/package/yodaos/libapp_manager

This file was deleted.

1 change: 0 additions & 1 deletion openwrt/package/yodaos/libeloop_mini

This file was deleted.

49 changes: 49 additions & 0 deletions openwrt/package/yodaos/libeloop_mini/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

include $(TOPDIR)/rules.mk

PKG_NAME:=libeloop_mini
PKG_VERSION:=
PKG_RELEASE:=1
PKG_SOURCE_DIR:=$(ROKID_DIR)/framework/libs/libeloop_mini
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0+

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk


define Package/libeloop_mini
SECTION:=libs
CATEGORY:=rokid
DEPENDS+= +libpthread
TITLE:=libeloop_mini
endef

define Package/libeloop_mini/description
eloop_run lib
endef

define Build/Prepare
echo $(PKG_BUILD_DIR)
$(CP) $(PKG_SOURCE_DIR)/* $(PKG_BUILD_DIR)
endef

define Build/InstallDev
echo "zpershuai build stage"
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/build/*.so $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include/eloop_mini
$(CP) $(PKG_BUILD_DIR)/include/eloop.h $(1)/usr/include/eloop_mini/
$(CP) $(PKG_BUILD_DIR)/include/eloop.h $(1)/usr/include/eloop_mini/
endef



define Package/libeloop_mini/install
echo "zpershuai build adfadfasdf"
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/build/*.so $(1)/usr/lib
endef

$(eval $(call BuildPackage,libeloop_mini))
1 change: 0 additions & 1 deletion openwrt/package/yodaos/librplayer

This file was deleted.

6 changes: 6 additions & 0 deletions openwrt/package/yodaos/librplayer/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config BR2_PACKAGE_LIBRPLAYER
bool "rokid librplayer sdk"
select BR2_PACKAGE_FFMPEG
select BR2_PACKAGE_SDL2
select BR2_PACKAGE_PULSEAUDIO
default y
Loading

0 comments on commit 8890bb4

Please sign in to comment.