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