Finding generic Bluetooth devices within reach

后端 未结 4 1951
半阙折子戏
半阙折子戏 2021-01-03 07:03

We are using the iOS private framework BluetoothManager for a simple experiment -- to find discoverable generic (non-iOS) BT devices within reach. Now, only the fol

4条回答
  •  醉酒成梦
    2021-01-03 07:59

    You need to use BluetoothManager to turn Bluetooth on, and then to enable bluetooth scanning of remote devices.

    Having registered a notification callback, you will get the discovered devices. The notification object is actually a pointer to a BluetoothDevice object.

    Get the BluetoothDevice object pointer, and from there you can get the name, address or connect to the remote device.

    There is no RSSI here, you can see the complete list of methods by looking at the BluetoothDevice.h file.

    I wrote a complete sample, compatible with iOS 5.1, here: http://www.pocketmagic.net/?p=2827

    Good luck!

提交回复
热议问题