Shift X2 status from legacy to archived
[khatus.git] / x4 / bin / khatus_x4_sensor_bluetooth
1 #! /bin/sh
2
3 set -e
4
5 . "$(dirname $(realpath $0))/khatus_x4_lib_common_sensor.sh"
6
7 count_powered_controllers() {
8 bluetoothctl -- show | grep -c 'Powered: yes'
9 }
10
11 count_connected_devices() {
12 bluetoothctl -- paired-devices \
13 | awk '{print $2}' \
14 | xargs -I % bluetoothctl -- info % \
15 | grep -c 'Connected: yes'
16 }
17
18 sensor() {
19 printf "count_powered_controllers %d\n" $(count_powered_controllers)
20 printf "count_connected_devices %d\n" $(count_connected_devices)
21 }
22
23 run_as_poller
This page took 0.071025 seconds and 4 git commands to generate.