bluetooth-init: ccimx93: adjust power levels

https://onedigi.atlassian.net/browse/DEL-8327
https://onedigi.atlassian.net/browse/DEL-8458

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
Isaac Hermida 2023-10-09 13:18:16 +02:00
parent 23ffb5c1bc
commit f44ae189e5
1 changed files with 6 additions and 2 deletions

View File

@ -40,6 +40,10 @@ set_btaddr() {
hciconfig ${HCI_IFACE} up hciconfig ${HCI_IFACE} up
} }
set_power_config() {
sh -e /lib/firmware/nxp/bt_power_config_US_CA_JP.sh
}
is_kernel_module_loaded() { is_kernel_module_loaded() {
lsmod | grep -qs -w "^${MODULE_NAME}" lsmod | grep -qs -w "^${MODULE_NAME}"
} }
@ -56,8 +60,8 @@ bluetooth_start() {
power 0 && sleep 0.2 && power 1 power 0 && sleep 0.2 && power 1
# Load manually the kernel module # Load manually the kernel module
modprobe "${MODULE_NAME}" modprobe "${MODULE_NAME}"
# Reconfigure the HCI interface with the expected MAC address # Reconfigure the HCI interface with the expected MAC address and power levels
is_kernel_module_loaded && set_btaddr && log "Bluetooth activated" && return 0 is_kernel_module_loaded && set_btaddr && set_power_config && log "Bluetooth activated" && return 0
log "[ERROR] Cannot initialize Bluetooth correctly" && return 1 log "[ERROR] Cannot initialize Bluetooth correctly" && return 1
} }