mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
aic-bluetooth: Targeted process management and error handling
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
This commit is contained in:
committed by
c0rnelius
parent
09f263f751
commit
6f08f2d0d8
@@ -1,15 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# HW Reset
|
set -e
|
||||||
hciattach -r -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1
|
|
||||||
|
|
||||||
# Kill hciattach
|
# 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
|
sleep .50
|
||||||
killall hciattach
|
pkill -f "/dev/ttyS1" || true
|
||||||
|
|
||||||
# Attach Bluetooth HCI UART
|
# Attach Bluetooth HCI UART
|
||||||
sleep .50
|
sleep .50
|
||||||
hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1
|
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
|
rfkill unblock all
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user