Rokid系统新增模块(应用)

Rokid系统新增模块(应用)

需要遵循rokid系统的规范,目前还没有发现Rokid的专有系统的开发套件,只能与系统整体编译

1.新增加模块的代码位置

  • 参照wifi_monitor

robot/services/wifi_monitor

每个文件夹下面都需要有一个CMakeLists.txt文件

2.修改系统配置项

0)rokid_br_external/configs/rokid_common_packages.frag

1
BR2_PACKAGE_WIFI_MONITOR=y #注意“=”两边不能有空格

1)rokid_br_external/Config.in
rokid_br_external/Config.in文件中的一行

1
source "$BR2_EXTERNAL_ROKID_PATH/package/wifi_monitor/Config.in"

2)rokid_br_external/package/wifi_monitor/Config.in

1
2
3
4
config BR2_PACKAGE_WIFI_MONITOR
bool "rokid wifi monitor services"
select BR2_PACKAGE_AMS
select BR2_PACKAGE_WPA_CTRL

3)rokid_br_external/package/wifi_monitor/wifi_monitor.mk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
WIFI_MONITOR_SITE = $(call qstrip,$(BR2_EXTERNAL_ROKID_PATH)/../robot/services/wifi_monitor)
WIFI_MONITOR_SITE_METHOD = local
WIFI_MONITOR_DEPENDENCIES = wpa_ctrl
define WIFI_MONITOR_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/src/wifi_monitor $(TARGET_DIR)/usr/bin/wifi_monitor
$(INSTALL) -m 0755 -D ../rokid_br_external/package/wifi_monitor/wifimonitor.service \
$(TARGET_DIR)/usr/lib/systemd/system/wifimonitor.service
if [ ! -d $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants ] ; then \
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants ; \
fi
ln -sf ../../../../usr/lib/systemd/system/wifimonitor.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/wifimonitor.service
endef
$(eval $(cmake-package))