#! /bin/bash

#CHECK IF KVER IS bigger than 6.1
KVER=$(uname -r | cut -d'.' -f1,2 | sed 's/\.//')
if [ "$KVER" -ge 61 ]; then
    exit 0
fi

/usr/sbin/rfkill block 0
/usr/sbin/rfkill block bluetooth
/bin/sleep 2
/usr/sbin/rfkill unblock 0
/usr/sbin/rfkill unblock bluetooth

# FIXME Delay
/bin/sleep 1

brcm_patchram_plus --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 --baudrate 1500000 --patchram /lib/firmware/SYN43711A0.hcd /dev/ttyS7