armbian-build/packages/bsp/aic8800/aic-bluetooth
Patrick Yavitz 6f08f2d0d8 aic-bluetooth: Targeted process management and error handling
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
2025-08-05 07:39:19 -04:00

24 lines
441 B
Bash
Executable File

#!/bin/bash
set -e
# HW Reset
if ! hciattach -r -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1; then
echo "Failed to reset HCI device" >&2
exit 1
fi
# Kill process using device
sleep .50
pkill -f "/dev/ttyS1" || true
# Attach Bluetooth HCI UART
sleep .50
if ! hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1; then
echo "Failed to attach HCI device" >&2
exit 1
fi
rfkill unblock all
exit 0