diff --git a/CMakeLists.txt b/CMakeLists.txt index c8b1f9e..71cf4a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ set(script_files scripts/termux-api-stop scripts/termux-audio-info scripts/termux-battery-status + scripts/termux-bluetooth-scan scripts/termux-brightness scripts/termux-call-log scripts/termux-camera-info diff --git a/scripts/termux-bluetooth-scan.in b/scripts/termux-bluetooth-scan.in new file mode 100644 index 0000000..9446abf --- /dev/null +++ b/scripts/termux-bluetooth-scan.in @@ -0,0 +1,25 @@ +#!@TERMUX_PREFIX@/bin/sh +set -e -u + +SCRIPTNAME=termux-bluetooth-scan +show_usage () { + echo "Usage: $SCRIPTNAME " + echo "Scan for Bluetooth devices." + exit 0 +} + +while getopts :h option +do + case "$option" in + h) show_usage;; + ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1; + esac +done +shift $((OPTIND-1)) + +if [ $# = 1 ]; then + @TERMUX_PREFIX@/libexec/termux-api BluetoothScan --es mode "$1" +else + echo "$SCRIPTNAME: You didnt specify the mode to use." >&2 + exit 1 +fi