summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter A. Bigot <pab@pabigot.com>2018-05-07 07:44:24 -0500
committerAndrei Gherzan <andrei@gherzan.com>2018-05-09 16:45:50 +0100
commit53af636f88d13141e70e53bc33d571a207122b03 (patch)
treec12395bc76c204a3126d3306d27c71e1861f065d
parent2a0f25a71fa8d204af9774f3f519a54580c1152a (diff)
downloadmeta-raspberrypi-53af636f88d13141e70e53bc33d571a207122b03.tar.gz
pi-bluetooth: create to provide standard raspbian script for bluetooth setup
Unique bluetooth device addresses are not assigned correctly with some firmware, resulting in a fixed default address. Use the same utility as raspbian does to initialize the device. Closes #236 Signed-off-by: Peter A. Bigot <pab@pabigot.com>
-rw-r--r--recipes-connectivity/bluez5/bluez5/brcm43438.service2
-rw-r--r--recipes-connectivity/bluez5/bluez5_%.bbappend14
-rw-r--r--recipes-connectivity/pi-bluetooth/pi-bluetooth.bb22
3 files changed, 33 insertions, 5 deletions
diff --git a/recipes-connectivity/bluez5/bluez5/brcm43438.service b/recipes-connectivity/bluez5/bluez5/brcm43438.service
index df699a4..a51f6bc 100644
--- a/recipes-connectivity/bluez5/bluez5/brcm43438.service
+++ b/recipes-connectivity/bluez5/bluez5/brcm43438.service
@@ -8,7 +8,7 @@ After=dev-serial1.device
8[Service] 8[Service]
9Type=oneshot 9Type=oneshot
10RemainAfterExit=yes 10RemainAfterExit=yes
11ExecStart=/usr/bin/hciattach -n /dev/serial1 bcm43xx 921600 noflow - 11ExecStart=/usr/bin/btuart
12 12
13[Install] 13[Install]
14WantedBy=multi-user.target 14WantedBy=multi-user.target
diff --git a/recipes-connectivity/bluez5/bluez5_%.bbappend b/recipes-connectivity/bluez5/bluez5_%.bbappend
index a480987..c75f4b6 100644
--- a/recipes-connectivity/bluez5/bluez5_%.bbappend
+++ b/recipes-connectivity/bluez5/bluez5_%.bbappend
@@ -8,14 +8,20 @@ BCM_BT_SOURCES = " \
8 file://brcm43438.service \ 8 file://brcm43438.service \
9 " 9 "
10 10
11BCM_BT_SERVICE = "brcm43438.service"
12
11enable_bcm_bluetooth() { 13enable_bcm_bluetooth() {
12 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 14 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
13 install -d ${D}${systemd_unitdir}/system 15 install -d ${D}${systemd_unitdir}/system
14 install -m 0644 ${WORKDIR}/brcm43438.service ${D}${systemd_unitdir}/system 16 install -m 0644 ${WORKDIR}/${BCM_BT_SERVICE} ${D}${systemd_unitdir}/system
15 fi 17 fi
16} 18}
17 19
18BCM_BT_SERVICE = " brcm43438.service" 20BCM_BT_RDEPENDS = "\
21 udev-rules-rpi \
22 bluez-firmware-raspbian \
23 pi-bluetooth \
24"
19 25
20# for raspberrypi3 26# for raspberrypi3
21SRC_URI_append_raspberrypi3 = " ${BCM_BT_SOURCES}" 27SRC_URI_append_raspberrypi3 = " ${BCM_BT_SOURCES}"
@@ -26,7 +32,7 @@ do_install_append_raspberrypi3() {
26 32
27SYSTEMD_SERVICE_${PN}_append_raspberrypi3 = " ${BCM_BT_SERVICE}" 33SYSTEMD_SERVICE_${PN}_append_raspberrypi3 = " ${BCM_BT_SERVICE}"
28 34
29RDEPENDS_${PN}_append_raspberrypi3 = " udev-rules-rpi bluez-firmware-raspbian" 35RDEPENDS_${PN}_append_raspberrypi3 = " ${BCM_BT_RDEPENDS}"
30 36
31# for raspberrypi0-wifi 37# for raspberrypi0-wifi
32SRC_URI_append_raspberrypi0-wifi = " ${BCM_BT_SOURCES}" 38SRC_URI_append_raspberrypi0-wifi = " ${BCM_BT_SOURCES}"
@@ -37,4 +43,4 @@ do_install_append_raspberrypi0-wifi() {
37 43
38SYSTEMD_SERVICE_${PN}_append_raspberrypi0-wifi = " ${BCM_BT_SERVICE}" 44SYSTEMD_SERVICE_${PN}_append_raspberrypi0-wifi = " ${BCM_BT_SERVICE}"
39 45
40RDEPENDS_${PN}_append_raspberrypi0-wifi = " udev-rules-rpi bluez-firmware-raspbian" 46RDEPENDS_${PN}_append_raspberrypi0-wifi = " ${BCM_BT_RDEPENDS}"
diff --git a/recipes-connectivity/pi-bluetooth/pi-bluetooth.bb b/recipes-connectivity/pi-bluetooth/pi-bluetooth.bb
new file mode 100644
index 0000000..e185f25
--- /dev/null
+++ b/recipes-connectivity/pi-bluetooth/pi-bluetooth.bb
@@ -0,0 +1,22 @@
1SUMMARY = "Script to properly configure BT-HCI on Raspberry Pi"
2HOMEPAGE = "https://github.com/RPi-Distro/pi-bluetooth"
3SECTION = "kernel"
4LICENSE = "BSD-3-Clause"
5LIC_FILES_CHKSUM = "\
6 file://debian/copyright;md5=6af8de3c8ee71f8e91e9b22f84ff2022 \
7"
8
9SRC_URI = "git://github.com/RPi-Distro/pi-bluetooth"
10SRCREV = "2a7477966bb3c69838b224f3ea92cb49a88124d5"
11UPSTREAM_VERSION_UNKNOWN = "1"
12
13S = "${WORKDIR}/git"
14
15inherit allarch
16
17do_install() {
18 install -d ${D}${bindir}
19 install -m 0755 ${S}/usr/bin/btuart ${D}${bindir}
20}
21
22FILES_${PN} = "${bindir}"