btscan-shell
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
btscan-shell [2021/11/22 23:28] – créée jeronimmo | btscan-shell [2021/12/08 15:08] (Version actuelle) – jeronimmo | ||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
Nécessite l’installation préablable du paquet // | Nécessite l’installation préablable du paquet // | ||
+ | < | ||
- | #!/bin/bash | + | <table style=" |
+ | < | ||
+ | < | ||
+ | <td style=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <p style=" | ||
+ | < | ||
+ | < | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | <p style=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
- | # beacon-scan.sh | ||
- | # Displays beacons including duplicates in real time. | ||
- | # Uses expect to automate interaction with bluetoothctl. | ||
- | # Uses sed to remove bluetoothctl colorization escape characters. | ||
- | # Uses grep to filter out beacon manufacturer data logging. | ||
- | # Uses Perl to prefix each beacon with a timestamp. | ||
- | |||
- | if [ "$(id -u)" != " | ||
- | echo " | ||
- | exit 1 | ||
- | fi | ||
- | |||
- | (cat <<' | ||
- | |||
- | set Prompt "#" | ||
- | set timeout -1 | ||
- | |||
- | spawn bluetoothctl | ||
- | |||
- | expect -re $Prompt | ||
- | send "scan off\r" | ||
- | |||
- | expect -re $Prompt | ||
- | send " | ||
- | |||
- | expect -re $Prompt | ||
- | send " | ||
- | |||
- | expect -re $Prompt | ||
- | send " | ||
- | |||
- | expect -re $Prompt | ||
- | send "scan on\r" | ||
- | |||
- | trap { | ||
- | expect -re $Prompt | ||
- | send "scan off\r" | ||
- | |||
- | expect -re $Prompt | ||
- | send " | ||
- | |||
- | expect -re $Prompt | ||
- | send " | ||
- | } SIGINT | ||
- | |||
- | expect eof | ||
- | |||
- | END | ||
- | ) | sed --unbuffered --quiet --expression ' | ||
- | | perl -nle 'print scalar(localtime), |
btscan-shell.1637620123.txt.gz · Dernière modification : 2021/11/22 23:28 de jeronimmo