home
/
code
/
khatus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update bluetooth censor and test drive
[khatus.git]
/
x2
/
src
/
bash
/
exe
/
khatus_sensor_bluetooth.sh
diff --git
a/x2/src/bash/exe/khatus_sensor_bluetooth.sh
b/x2/src/bash/exe/khatus_sensor_bluetooth.sh
index
4e696c8
..
af84abd
100644
(file)
--- a/
x2/src/bash/exe/khatus_sensor_bluetooth.sh
+++ b/
x2/src/bash/exe/khatus_sensor_bluetooth.sh
@@
-7,13
+7,14
@@
FS1='|' # Fields separator, level 1 (a record's fields)
FS2=':' # Fields separator, level 2 (a field's subfields)
count_powered_controllers() {
FS2=':' # Fields separator, level 2 (a field's subfields)
count_powered_controllers() {
-
bluetoothctl -- show
| grep -c 'Powered: yes'
+
echo show | bluetoothctl
| grep -c 'Powered: yes'
}
count_connected_devices() {
}
count_connected_devices() {
- bluetoothctl -- paired-devices \
- | awk '{print $2}' \
- | xargs -I % bluetoothctl -- info % \
+ echo paired-devices \
+ | bluetoothctl \
+ | awk '/^Device +[0-9a-zA-Z][0-9a-zA-Z]:/ {print $2}' \
+ | xargs -I % sh -c 'echo info % | bluetoothctl' \
| grep -c 'Connected: yes'
}
| grep -c 'Connected: yes'
}
This page took
0.017545 seconds
and
4
git commands to generate.