ブルーズ5.28
目標 - iOS のトラック スキップを制御し、プログラムで Bluez から接続を開始します。a2dp は必要ありません。
iPhone/iPad から接続を開始すると (BT 設定に移動し、Pi デバイスをクリックします)、すべて正常に動作します。(Piでの車のセットアップ)。メタデータの管理、追跡などを行っています。
connect xx:xx:xx:xx:xx:xx
bluetoothctl でaを実行すると、次の結果が得られます。
a2dp-source profile connect failed for 6C:70:9F:7E:EF:A8: Protocol not available
Ok。pulseaudio + モジュールが必要です。それをインストールしたら、Bluez から接続できるようになりました。ただし、Bluez をオーディオ出力デバイスとして追加し、自動的に選択するようになりました。それを望まず、再び電話をいじる必要があります。コントロールしたいだけ。OSのどこからでも出力デバイスを変更でき、設定に移動する必要がないため、何もない場合でもこれを好みます。
では、a2dp をまとめて無効にして見てみましょう。
/usr/libexec/bluetooth/bluetoothd -d -C -n --noplugin=a2dp
また
/usr/libexec/bluetooth/bluetoothd -d -C -n --plugin=avrcp
上記の両方で同じ結果
bluetoothd[14176]: src/device.c:connect_profiles() /org/bluez/hci0/dev_6C_70_9F_7E_EF_A8 (all), client :1.57
bluetoothd[14176]: src/device.c:connect_profiles() Resolving services for /org/bluez/hci0/dev_6C_70_9F_7E_EF_A8
bluetoothd[14176]: src/adapter.c:connected_callback() hci0 device 6C:70:9F:7E:EF:A8 connected eir_len 19
bluetoothd[14176]: src/device.c:search_cb() 6C:70:9F:7E:EF:A8: No service update
bluetoothd[14176]: src/device.c:device_svc_resolved() /org/bluez/hci0/dev_6C_70_9F_7E_EF_A8 err 0
bluetoothd[14176]: src/device.c:connect_profiles() /org/bluez/hci0/dev_6C_70_9F_7E_EF_A8 (all), client :1.57
bluetoothd[14176]: src/adapter.c:dev_disconnected() Device 6C:70:9F:7E:EF:A8 disconnected, reason 3
bluetoothd[14176]: src/adapter.c:adapter_remove_connection()
bluetoothd[14176]: plugins/policy.c:disconnect_cb() reason 3
bluetoothd[14176]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr 6C:70:9F:7E:EF:A8 type 0 status 0xe
bluetoothd[14176]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
bluetoothd[14176]: src/device.c:device_bonding_failed() status 14
bluetoothd[14176]: src/adapter.c:resume_discovery()
繰り返しますが、Bluetooth 設定に移動して iPhone のデバイスをクリックすると、すべてが思いどおりに機能します。問題は、Bluez からの接続です。
iOS が a2dp を要求しているように見えますが、Bluez をそれを通過させる方法や、利用可能な広告を停止する方法がわかりません。プロファイルを無効にするためのjaibreakオプションがあることは知っていますが、それをきれいに保とうとしています。
また、キーストロークを送信するように機能する HID セットアップも試しましたが、オンスクリーン キーボードが非表示になります。
ありがとう!