Bluetoothctl終了後に広告を停止する

Bluetoothctl終了後に広告を停止する

BLEサーバーを作成しようとしています。これを行うには、bluetoothctlと次のコマンドを使用します。

menu advertise
name MyDevice
back
advertise on
menu gatt
register-service 8733587e-8f8a-11ee-b9d1-0242ac120002
yes
register-characteristic 0x0001 broadcast
0x0001
register-characteristic 0x0002 write
0x0001
register-characteristic 0x0003 write
0x0001
register-characteristic 0x0004 write
0x0001
register-characteristic 0x0005 read
0x0001
register-application

その後、携帯電話を使用してデバイスに接続できます。ただし、bluetoothctlを終了すると再接続できなくなり、以前の接続が失われます。
私は次のようなbashスクリプトを使ってこれをやろうとしています。

bluetoothctl << EOF
*commands here*

ただし、bluetoothctlで自動的にシャットダウンして接続できません。これを正しい方法で行う方法は?よろしくお願いします。

ベストアンサー1

おすすめ記事