次の方法で共有


ヒューマン デバイス アダプター

ヒューマン デバイス アダプター (HDA) は、Bluetooth テスト プラットフォーム (BTP) と手動でやり取りする do-itです。これにより、まだ自動化されていない BTP でデバイスを使用できます。 たとえば、HDA を使用すると、BTP に接続する明確な方法がない購入済みのヘッドセットと対話できるようになります。 HDA を使用すると、外部ハードウェア (Traduci など) を使用せずに、Windows デバイスとプロトタイプ作成ハードウェアの間で手動でユーザー テストを行えます。 そのため、セットアップに必要なのは、Bluetoothと独自のテスト デバイスをサポートする PC です。

HDA のセットアップ

HDA をサポートするには 、「BTP ソフトウェアセットアップ」 の説明に従ってソフトウェアをインストールします。

HDA 構成ファイル

テスト デバイスにちなんだ構成ファイルを作成します ( 例:mytestdevice.txt)。 ファイル名と拡張子は重要ではありません。 構成ファイルには、次の情報が含まれている必要があります。

name=myTestDevice
baseband=BR
br_address=B4:F1:DA:96:C0:A4

HDA ペアリング テスト

BTP ソフトウェア パッケージが抽出されたフォルダー (通常は C:\BTP) に移動します。 スクリプトはパッケージ ディレクトリのサブフォルダーにあります。 目的のコマンド環境に適したスクリプトを実行します。

コマンド環境 スクリプト
管理者特権でのコマンド プロンプト RunPairingTests.bat HDA,conf_file=<configuration file name>
管理者特権の PowerShell コンソール RunPairingTests.ps1 HDA,conf_file=<configuration file name>

省略可能なパラメーター -VerboseLogs を追加して、デバッグに役立つ BTP の内部操作のより詳細な出力を提供できます。

HDA 手動ペアリング

  1. このスクリプトは、デバイスが以前にペアリングされているかどうかを確認します。 y で応答すると、スクリプトによってペアリングが削除されます。 n で応答した場合、処理は続行され、アクションはありません。

    Verify: SUCCEEDED(WEX::TestExecution::RuntimeParameters::TryGetValue(deviceParameterName.c_str(), deviceParametersStr)): Getting required runtime parameter 'central'
    [BluetoothTests::PairingTestsImpl::PairingTestsImpl]: Using central device named: MyCentralDevice
    [BluetoothTests::PairingTestsImpl::PairingTestsImpl]: Using peripheral device named: MyTestDevice
    [BluetoothTestHelpers::Pairing::Unpair]: Unpairing device with address B4F1DA96C0A4 from the device with address D83BBFAC35607
    [BluetoothTestHelpers::Pairing::Unpair]: Unpaired successfully
    [BluetoothTestHelpers::Pairing::WaitForDisconnection]: Waiting for disconnection of device with address B4F1DA96C0A4
    [BluetoothTestHelpers::Pairing::WaitForDisconnection]: Asserted: connectionModule.WaitForDisconnection(otherDeviceAddress, c_disconnectionAfterUnpairingTimeout)
    [BluetoothTestHelpers::Pairing::WaitForDisconnection]: Disconnected successfully
    Is MyTestDevice paired to the device with address D83BBFAC35607?
    Enter (y/n): y
    

    次の例は、ペアリングを削除する HDA を示しています。 また、デバイス上のペアリング情報 (ここでは "MyTestDevice" という名前) を削除するように求められます。 ペアリング情報が削除されたら、任意のキーを押して続行します。

    [BluetoothTestHelpers::Pairing::Unpair]: Unpairing device with address D83BBFAC35607 Public from the device with address D83BBFAC35607 Public
    If possible, delete the pairing on MyTestDevice
    Press any key to continue
    
  2. その後、スクリプトはチェックを実行してペアリング プロセスを開始し、ユーザーにデバイス ("MyTestDevice" という名前) を "バンド ペアリング モード" に入力するよう求めます。 デバイスをペアリング モードにした後、任意のキーを押して続行します。

    StartGroup: BluetoothTests::TaefPairingTests::OutgoingJustWorksPairingTest
    [BluetoothTests::PairingTestsImpl::OutgoingJustWorksPairingTest]: Will attempt an outgoing pairing to the peripheral device and validate that a JustWorks ceremony was used
    [BluetoothTestHelpers::Pairing::Pair]: Asserted: (originDeviceAssociationModule) != nullptr
    [BluetoothTestHelpers::Pairing::Pair]: Asserted: originDeviceAssociationModule->CanInitiatePairing()
    [BluetoothTestHelpers::Pairing::Pair]: Asserted: originDeviceAssociationModule->CanCheckPairingStatus()
    [BluetoothTestHelpers::Pairing::Pair]: Asserted: !(originDeviceAssociationModule->IsPairedTo(destinationDeviceAddress))
    If not already, put MyTestDevice in BR pairing mode
    Press any key to continue . . .
    
  3. スクリプトによってペアリングが開始されます。 ペアリングが成功すると、次の出力が表示されます。 デバイスまたはテスト PC 上の通知に応答して、ペアリングを確認して完了します。 テストでは、デバイスをペアリング モードから外すよう求められます。 デバイスをペアリング モードから切り替えたら、任意のキーを押して続行します。

    [BluetoothTestHelpers::Pairing::Pair]: Initiating pairing request from device with address D83BBFAC35607 to device with address B4F1DA96C0A4
    [BluetoothTestHelpers::Pairing::DefaultPairingCeremonyHandler::OnJustWorks]: JustWorks ceremony used
    [BluetoothTestHelpers::Pairing::Pair]: Asserted: originDeviceAssociationModule->IsPairedTo(destinationDeviceAddress)
    [BluetoothTestHelpers::Pairing::Pair]: Asserted: ceremonyHandler.GetLastCeremonyUsed().has_value()
    [BluetoothTestHelpers::Pairing::Pair]: Asserted: ceremonyHandler.GetLastCeremonyUsed().value() == expectedCeremony
    [BluetoothTestHelpers::Pairing::Pair]: Paired successfully
    If the device is in pairing mode, exit pairing mode if possible.
    Press any key to continue . . .
    
  4. ペアリングが完了すると、スクリプトはテスト スイートで使用可能なテストに進みます。 利用可能なテストとその実行方法に関するドキュメントは、現在サポートされている BTP テストで確認できます

HDA ログ キャプチャ

問題が発生した場合は、 Bluetoothログをキャプチャするために GitHub の Busiotools for Windows Repo にある手順に従うか、テスト開始時にスクリプトオプション-VerboseLogsを使用してBluetoothログをキャプチャできます。

こちらも参照ください