Android蓝牙常用函数

BlueToothDevice
常用函数
getAddress() //Returns the hardware address of this BluetoothDevice
getName() //Get the friendly Bluetooth name of the remote device
createBond() //Start the bonding (pairing) process with the remote device.
removeBond() //Remove bond (pairing) with the remote device.
getUuids() //Returns the supported features (UUIDs) of the remote device.
connectGatt() //Connect to GATT Server hosted by this device.

BluetoothA2dp
常用函数
connect() //Initiate connection to a profile of the remote Bluetooth device.
disconnect() //Initiate disconnection from a profile
getConnectedDevices() //Get connected devices for this specific profile.
setActiveDevice() //Select a connected device as active. The active device selection is per profile. An active device’s purpose is profile-specifi
getActiveDevice() //Get the connected device that is active.

BluetoothAdapter
常用函数
getDefaultAdapter() //Get a handle to the default local Bluetooth adapter.
getRemoteDevice() //Get a BluetoothDevice object for the given Bluetooth hardware address.
startDiscovery() //Start the remote device discovery process.
cancelDiscovery() //Cancel the current device discovery process.
getBondedDevices() //Return the set of BluetoothDevice objects that are bonded (paired) to the local adapter.
setScanMode() //Set the Bluetooth scan mode of the local Bluetooth adapter.
isEnabled() //Return true if Bluetooth is currently enabled and ready for use.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值