Update bluetooth docs & add udev rules (#92)

* Update bluetooth docs

* add udev rules

* Add cmp to build

* Create bluetooth.md
This commit is contained in:
Pascal Vizeli 2018-07-10 10:11:58 +02:00 committed by Pascal Vizeli
parent bf69f2e974
commit 173596eec5
4 changed files with 40 additions and 3 deletions

View File

@ -0,0 +1,12 @@
# Bluetooth
We support `bluetoothctl` on host. Later we want also support bluetooth trought UI.
All pairs and settings are persistent over reboots and updates.
If you want setup bluetooth on host, use the *bluetoothctl* utility.
## Scan devices
```
[bluetooth]# scan on
```

View File

@ -398,7 +398,7 @@ CONFIG_SHOWKEY=y
CONFIG_AWK=y
CONFIG_FEATURE_AWK_LIBM=y
CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y
# CONFIG_CMP is not set
CONFIG_CMP=y
# CONFIG_DIFF is not set
# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
# CONFIG_FEATURE_DIFF_DIR is not set

View File

@ -16,14 +16,17 @@ define BLUETOOTH_BCM43XX_BUILD_CMDS
endef
define BLUETOOTH_BCM43XX_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/etc/systemd/system/hassos-hardware.wants
mkdir -p $(TARGET_DIR)/etc/systemd/system/hassos-hardware.target.wants
cp -f $(@D)/bluetooth-bcm43xx $(TARGET_DIR)/usr/sbin/
cp -f $(@D)/bluetooth-bcm43xx.service $(TARGET_DIR)/usr/lib/systemd/system/
ln -fs /usr/lib/systemd/system/bluetooth-bcm43xx.service $(TARGET_DIR)/etc/systemd/system/hassos-hardware.wants/
ln -fs /usr/lib/systemd/system/bluetooth-bcm43xx.service $(TARGET_DIR)/etc/systemd/system/hassos-hardware.target.wants/
mkdir -p $(TARGET_DIR)/lib/firmware/brcm
cp -f $(@D)/BCM43430A1.hcd $(TARGET_DIR)/lib/firmware/brcm/
cp -f $(@D)/BCM4345C0.hcd $(TARGET_DIR)/lib/firmware/brcm/
mkdir -p $(TARGET_DIR)/etc/udev/rules.d
cp -f $(@D)/bluetooth-bcm43xx.rules $(TARGET_DIR)/etc/udev/rules.d/
endef
$(eval $(generic-package))

View File

@ -0,0 +1,22 @@
KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
echo 0;\
elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi\
'", SYMLINK+="serial%c"
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
echo 0; \
elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi \
'", SYMLINK+="serial%c"