diff options
author | Peter A. Bigot <pab@pabigot.com> | 2018-05-07 07:44:24 -0500 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.com> | 2018-05-09 16:45:50 +0100 |
commit | 53af636f88d13141e70e53bc33d571a207122b03 (patch) | |
tree | c12395bc76c204a3126d3306d27c71e1861f065d | |
parent | 2a0f25a71fa8d204af9774f3f519a54580c1152a (diff) | |
download | meta-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.service | 2 | ||||
-rw-r--r-- | recipes-connectivity/bluez5/bluez5_%.bbappend | 14 | ||||
-rw-r--r-- | recipes-connectivity/pi-bluetooth/pi-bluetooth.bb | 22 |
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] |
9 | Type=oneshot | 9 | Type=oneshot |
10 | RemainAfterExit=yes | 10 | RemainAfterExit=yes |
11 | ExecStart=/usr/bin/hciattach -n /dev/serial1 bcm43xx 921600 noflow - | 11 | ExecStart=/usr/bin/btuart |
12 | 12 | ||
13 | [Install] | 13 | [Install] |
14 | WantedBy=multi-user.target | 14 | WantedBy=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 | ||
11 | BCM_BT_SERVICE = "brcm43438.service" | ||
12 | |||
11 | enable_bcm_bluetooth() { | 13 | enable_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 | ||
18 | BCM_BT_SERVICE = " brcm43438.service" | 20 | BCM_BT_RDEPENDS = "\ |
21 | udev-rules-rpi \ | ||
22 | bluez-firmware-raspbian \ | ||
23 | pi-bluetooth \ | ||
24 | " | ||
19 | 25 | ||
20 | # for raspberrypi3 | 26 | # for raspberrypi3 |
21 | SRC_URI_append_raspberrypi3 = " ${BCM_BT_SOURCES}" | 27 | SRC_URI_append_raspberrypi3 = " ${BCM_BT_SOURCES}" |
@@ -26,7 +32,7 @@ do_install_append_raspberrypi3() { | |||
26 | 32 | ||
27 | SYSTEMD_SERVICE_${PN}_append_raspberrypi3 = " ${BCM_BT_SERVICE}" | 33 | SYSTEMD_SERVICE_${PN}_append_raspberrypi3 = " ${BCM_BT_SERVICE}" |
28 | 34 | ||
29 | RDEPENDS_${PN}_append_raspberrypi3 = " udev-rules-rpi bluez-firmware-raspbian" | 35 | RDEPENDS_${PN}_append_raspberrypi3 = " ${BCM_BT_RDEPENDS}" |
30 | 36 | ||
31 | # for raspberrypi0-wifi | 37 | # for raspberrypi0-wifi |
32 | SRC_URI_append_raspberrypi0-wifi = " ${BCM_BT_SOURCES}" | 38 | SRC_URI_append_raspberrypi0-wifi = " ${BCM_BT_SOURCES}" |
@@ -37,4 +43,4 @@ do_install_append_raspberrypi0-wifi() { | |||
37 | 43 | ||
38 | SYSTEMD_SERVICE_${PN}_append_raspberrypi0-wifi = " ${BCM_BT_SERVICE}" | 44 | SYSTEMD_SERVICE_${PN}_append_raspberrypi0-wifi = " ${BCM_BT_SERVICE}" |
39 | 45 | ||
40 | RDEPENDS_${PN}_append_raspberrypi0-wifi = " udev-rules-rpi bluez-firmware-raspbian" | 46 | RDEPENDS_${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 @@ | |||
1 | SUMMARY = "Script to properly configure BT-HCI on Raspberry Pi" | ||
2 | HOMEPAGE = "https://github.com/RPi-Distro/pi-bluetooth" | ||
3 | SECTION = "kernel" | ||
4 | LICENSE = "BSD-3-Clause" | ||
5 | LIC_FILES_CHKSUM = "\ | ||
6 | file://debian/copyright;md5=6af8de3c8ee71f8e91e9b22f84ff2022 \ | ||
7 | " | ||
8 | |||
9 | SRC_URI = "git://github.com/RPi-Distro/pi-bluetooth" | ||
10 | SRCREV = "2a7477966bb3c69838b224f3ea92cb49a88124d5" | ||
11 | UPSTREAM_VERSION_UNKNOWN = "1" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | inherit allarch | ||
16 | |||
17 | do_install() { | ||
18 | install -d ${D}${bindir} | ||
19 | install -m 0755 ${S}/usr/bin/btuart ${D}${bindir} | ||
20 | } | ||
21 | |||
22 | FILES_${PN} = "${bindir}" | ||