meta-agl-bsp: enable HCI UART for i.MX8MQ EVK
[AGL/meta-agl.git] / meta-agl-bsp / meta-freescale-layer / recipes-connectivity / hci-uart-helper / hci-uart-helper_1.0.bb
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/hci-uart-helper_1.0.bb b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/hci-uart-helper_1.0.bb
new file mode 100644 (file)
index 0000000..e497a4a
--- /dev/null
@@ -0,0 +1,30 @@
+SUMMARY     = "Helper for enabling UART connected HCI Bluetooth devices"
+LICENSE     = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit systemd allarch
+
+SRC_URI = "file://hci-uart-helper.service \
+           file://hci-uart-helper.sh \
+"
+
+COMPATIBLE_MACHINE = "imx8mqevk"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+    # Install helper script
+    install -d ${D}${sbindir}
+    install -m 0755 ${WORKDIR}/hci-uart-helper.sh ${D}${sbindir}/
+
+    # Install systemd unit
+    install -d ${D}${systemd_system_unitdir}/
+    install -m 0644 ${WORKDIR}/hci-uart-helper.service ${D}${systemd_system_unitdir}/
+    install -d ${D}${systemd_system_unitdir}/bluetooth.service.wants
+    ln -s ../hci-uart-helper.service ${D}${systemd_system_unitdir}/bluetooth.service.wants/
+}
+
+FILES_${PN} += "${systemd_system_unitdir}"
+
+RDEPENDS_${PN} += "bluez5"