bluez5-init: ccimx93: add fix to enable LE

This fix is needed for bluez-5.65 version.
We can drop it when using a newer version.

https://onedigi.atlassian.net/browse/DEL-8346

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
Isaac Hermida 2023-04-04 17:01:24 +02:00
parent f7943a9fd5
commit ac1e4633fb
1 changed files with 18 additions and 0 deletions

View File

@ -24,6 +24,21 @@ set_btaddr() {
hcitool -i ${HCI_IFACE} cmd 0x3f 0x0022 0xfe 0x06 ${bt_addr} hcitool -i ${HCI_IFACE} cmd 0x3f 0x0022 0xfe 0x06 ${bt_addr}
} }
le_fix() {
hcitool -i ${HCI_IFACE} cmd 0x03 0x0003
sleep 0.2
hcitool -i ${HCI_IFACE} cmd 0x03 0x0001 ff ff ff ff ff ff 3f ff
sleep 0.2
hcitool -i ${HCI_IFACE} cmd 0x08 0x0001 ff ff 7f 00 00 00 00 00
sleep 0.2
hcitool -i ${HCI_IFACE} cmd 0x08 0x000B 01 10 00 10 00 00 00
sleep 0.2
hcitool -i ${HCI_IFACE} cmd 0x08 0x000C 01 01
sleep 0.2
hcitool -i ${HCI_IFACE} cmd 0x08 0x000C 00 00
sleep 0.2
}
bluetooth_start() { bluetooth_start() {
if ! [ -e "/proc/device-tree/bluetooth/mac-address" ]; then if ! [ -e "/proc/device-tree/bluetooth/mac-address" ]; then
log "[ERROR] Bluetooth mac-address not found" log "[ERROR] Bluetooth mac-address not found"
@ -39,6 +54,9 @@ bluetooth_start() {
killall hciattach && \ killall hciattach && \
sleep 0.2 && \ sleep 0.2 && \
hciattach -t5 /dev/ttyBt any -s 3000000 3000000 flow && \ hciattach -t5 /dev/ttyBt any -s 3000000 3000000 flow && \
hciconfig ${HCI_IFACE} up && \
sleep 0.2 && \
le_fix && \
log "Bluetooth activated" && return log "Bluetooth activated" && return
log "[ERROR] Cannot initialize Bluetooth" log "[ERROR] Cannot initialize Bluetooth"