2
BT発見デバイスのサービス名を取得できる方法はありますか?私のbluetoothの発見ロジここAndroid bluetoothサービス名
startdiscovery()
{
boolean status1 = mBluetoothAdapter.startDiscovery();
}
BroadcastReceiver mReceiver = new BroadcastReceiver()
{
if (BluetoothDevice.ACTION_FOUND.equals(action))
{
if(intent.hasExtra(BluetoothDevice.EXTRA_DEVICE))
{
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
}
}
}
を次のように私は文字列形式で検出されたデバイスの唯一の「サービス名」を知っています。
bluetoothclass.hasService(int) - このAPIは、事前定義のSERVICE NAMESを入力パラメータとして使用し、TRUE/FALSEを返します。このAPIは私がSERVICE NAMEだけを知っているので使用できます。
ありがとうございます。 BluetootClass()では、発見されたデバイスが提供するサービスの名前を共有する要素は見つかりません – Vidz