2

ブルーズ5.28

目標 - iOS のトラック スキップを制御し、プログラムで Bluez から接続を開始します。a2dp は必要ありません。

iPhone/iPad から接続を開始すると (BT 設定に移動し、Pi デバイスをクリックします)、すべて正常に動作します。(Piでの車のセットアップ)。メタデータの管理、追跡などを行っています。

connect xx:xx:xx:xx:xx:xxbluetoothctl で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 セットアップも試しましたが、オンスクリーン キーボードが非表示になります。

ありがとう!

4

1 に答える 1

2

ソースからビルドされた 5.28 でやりたいことができましたが、軽く編集する必要がありました。

副作用はわかりませんが、私の目標はかなり狭いので、あまり気にしません.

編集profiles/audio/avrcp.c

追加

.auto_connect = true,

static struct btd_profile avrcp_target_profile = {@ 3863行目

static struct btd_profile avrcp_controller_profile = {@ 3946行目

make && make install

完全なブロック

static struct btd_profile avrcp_target_profile = {
        .name           = "audio-avrcp-target",
        .remote_uuid    = AVRCP_TARGET_UUID,
        .device_probe   = avrcp_target_probe,
        .device_remove  = avrcp_target_remove,
        .auto_connect   = true,
        .connect        = avrcp_connect,
        .disconnect     = avrcp_disconnect,
        .adapter_probe  = avrcp_target_server_probe,
        .adapter_remove = avrcp_target_server_remove,
};

...

static struct btd_profile avrcp_controller_profile = {
        .name           = "avrcp-controller",
        .remote_uuid    = AVRCP_REMOTE_UUID,
        .device_probe   = avrcp_controller_probe,
        .device_remove  = avrcp_controller_remove,
        .auto_connect   = true,
        .connect        = avrcp_connect,
        .disconnect     = avrcp_disconnect,
        .adapter_probe  = avrcp_controller_server_probe,
        .adapter_remove = avrcp_controller_server_remove,
};
于 2015-03-07T11:53:27.947 に答える