代码之家  ›  专栏  ›  技术社区  ›  anon

Android手机的蓝牙设备类别是什么?

  •  1
  • anon  · 技术社区  · 15 年前

    For my application i make a bluetooth discovery search to list all available bluetooth device in. If I'm in a room with a lot of computers etc, there is a really long list. So I'd like to filter Android phones from the lists.

    我阅读了以下文件: http://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.html http://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.Major.html

    所以我可以过滤一些设备,比如笔记本电脑,电脑等等。

    Does anybody know what are the possible constants which android phones can have? I don't want to risk to filter too many devices, but I also want to limit the list to only Android devices.

    有什么暗示吗?

    2 回复  |  直到 8 年前
        1
  •  5
  •   Neil McGuigan    8 年前

    http://linux.die.net/man/5/hcid.conf

    提供网络服务主要设备 班级分配:

    0x00: Miscellaneous
    
    0x01: Computer (desktop,notebook, PDA, organizers, .... )
    

    编辑: 其他几点注意事项:

    1. Android phones aren't in discoverable mode by default. So chances are, none of your discovered devices will ever be Android devices unless you have initiated discoverable mode on a device.

    2. Many phones can determine the RSSI (signal strength) of discovered devices. This information is passed to your app during discovery as a bundle extra . Nearby devices will generally have a higher RSSI than distant devices. So you can also filter by "how close the device is".

    3. The Bluetooth MAC used for various devices will be of certain ranges. The first three bytes of the Bluetooth MAC corresponds to the Hardware Vendor... There are many vendors, but most of them don't make bluetooth hardware for phones. So you could also filter by Bluetooth MAC - if it falls within a known range, it's probably an Android.

        2
  •  0
  •   Amit Padekar    8 年前

    以下是Android文档中列出的设备类链接

    BluetoothClass.Device.Major

    BluetoothClass.Device