Bluetooth---初步了解Android 蓝牙4.0

http://developer.android.com/reference/android/bluetooth/package-summary.html

android.bluttooth

提供管理蓝牙功能的类,例如对设备的扫描,连接设备,和管理设备之间的数据传输。蓝牙API支持经典蓝牙和低功耗蓝牙。

Provides classes that manage Bluetooth functionality, such as scanning for devices, connecting with devices, and managing data transfer between devices. The Bluetooth API supports both "Classic Bluetooth" and Bluetooth Low Energy.

有关更多的经典蓝牙信息,可以看Bluetooth指南。有关更多的低功耗蓝牙的信息,可以看BLE指南。

For more information about Classic Bluetooth, see the Bluetooth guide. For more information about Bluetooth Low Energy, see the Bluetooth Low Energy (BLE) guide.

Bluetooth APIs 可以使得应用具备以下功能:

1.对于其他的蓝牙设备的扫描(包括BLE设备)

2.为配对的蓝牙设备查询本地蓝牙适配器

3.建立RFCOMM channels/sockets.

4.连接在其它设备上指定的sockets

5.与其它设备之间传输数据

6.与BLE设备交流,例如接近传感器,心率监视器,健身设备,等等

7.作为GATT客户端或GATT服务端

使用这些APIs来完成蓝牙之间的交流,一个应用程序必须声明BLUETOOTH权限。对于一些额外的功能,如请求设备发现,也需要BLUETOOTH_ADMIN权限。

提示:不是所有的Android设备都提供了Bluetooth功能。

The Bluetooth APIs let applications:

  • Scan for other Bluetooth devices (including BLE devices).
  • Query the local Bluetooth adapter for paired Bluetooth devices.
  • Establish RFCOMM channels/sockets.
  • Connect to specified sockets on other devices.
  • Transfer data to and from other devices.
  • Communicate with BLE devices, such as proximity sensors, heart rate monitors, fitness devices, and so on.
  • Act as a GATT client or a GATT server (BLE).

To perform Bluetooth communication using these APIs, an application must declare the BLUETOOTH permission. Some additional functionality, such as requesting device discovery, also requires the BLUETOOTH_ADMIN permission.

Note: Not all Android-powered devices provide Bluetooth functionality.

接口:

BluetoothAdapter.LeScanCallback :用来提供LE扫描结果的回调接口

BluetoothProfile:Bluetooth Profiles的公共APIs

BluetoothProfile.ServiceListener:BluetoothProfile IPC 客户端与service的连接和断开时的一个通知接口


Interfaces


BluetoothAdapter.LeScanCallback Callback interface used to deliver LE scan results. 
BluetoothProfile Public APIs for the Bluetooth Profiles. 
BluetoothProfile.ServiceListener An interface for notifying BluetoothProfile IPC clients when they have been connected or disconnected to the service. 

类:

BluetoothA2dp:这个类提供控制Bluetooth A2DP profile的公共APIs

BluetoothAdapter:代表本地设备的Bluetooth adapter.
BluetoothAssignedNumbers:蓝牙分配号码

BluetoothClass:代表一个Bluetooth类,它描述了设备的一般特征(characteristics)和能力(capabilities)

BluetoothClass.Device:定义所有设备类的常量

BluetoothClass.Device.Major:定义所有主要设备类的常量

BluetoothClass.Service:定义所有服务类的常量

BluetoothDevice:代表一个远程蓝牙设备

=============================================================================================

BluetoothGatt:蓝牙GATT Profile的公共APIs

BluetoothGattCallback:这个抽象类用于实现BluetoothGatt回调

BluetoothGattCharacteristic:代表一个Bluetooth GATT Characteristic.

                                              一个GATT Characteristic是用来构造一个GATT service,BluetoothGattService的基本数据元素

BluetoothGattDescriptor:代表一个Bluetooth GATT Descriptor.

                                           GATT Descriptor包含一个GATT characteristic,BluetoothGattCharacteristic的额外信息和属性.



Classes


BluetoothA2dp This class provides the public APIs to control the Bluetooth A2DP profile. 
BluetoothAdapter Represents the local device Bluetooth adapter. 
BluetoothAssignedNumbers Bluetooth Assigned Numbers. 
BluetoothClass Represents a Bluetooth class, which describes general characteristics and capabilities of a device. 
BluetoothClass.Device Defines all device class constants. 
BluetoothClass.Device.Major Defines all major device class constants. 
BluetoothClass.Service Defines all service class constants. 
BluetoothDevice Represents a remote Bluetooth device. 
BluetoothGatt Public API for the Bluetooth GATT Profile. 
BluetoothGattCallback This abstract class is used to implement BluetoothGatt callbacks. 
BluetoothGattCharacteristic Represents a Bluetooth GATT Characteristic

A GATT characteristic is a basic data element used to construct a GATT service,BluetoothGattService

BluetoothGattDescriptor Represents a Bluetooth GATT Descriptor

GATT Descriptors contain additional information and attributes of a GATT characteristic,BluetoothGattCharacteristic

BluetoothGattServer Public API for the Bluetooth GATT Profile server role. 
BluetoothGattServerCallback This abstract class is used to implement BluetoothGattServer callbacks. 
BluetoothGattService Represents a Bluetooth GATT Service

Gatt Service contains a collection of BluetoothGattCharacteristic, as well as referenced services. 

BluetoothHeadset Public API for controlling the Bluetooth Headset Service. 
BluetoothHealth Public API for Bluetooth Health Profile. 
BluetoothHealthAppConfiguration The Bluetooth Health Application Configuration that is used in conjunction with the BluetoothHealthclass. 
BluetoothHealthCallback This abstract class is used to implement BluetoothHealth callbacks. 
BluetoothManager High level manager used to obtain an instance of an BluetoothAdapter and to conduct overall Bluetooth Management. 
BluetoothServerSocket A listening Bluetooth socket. 
BluetoothSocket A connected or connecting Bluetooth socket. 


BluetoothGattServer:Bluetooth GATT Profile服务器角色的公共APIs.

BluetoothGattServerCallback:这个抽象类用于实现BluetoothGattServer回调.

BluetoothGattService:代表一个Bluetooth GATT Service.

================================================================================

BluetoothHeadset:控制蓝牙耳机(Headset)服务的公共API.

BluetoothHealth:蓝牙Health Profile的公共API.

BluetoothHealthAppConfiguration:The Bluetooth Health Application Configuration(配置)用来与BluetoothHealth类结合.

BluetoothHealthCallback:用于实现BluetoothHealth回调的抽象类

BluetoothManager:用来获取BluetoothAdapter的实例的管理者,进行全面的蓝牙管理

BluetoothServerSocket:一个监听蓝牙的socket

BluetoothSocket:一个已连接或正在连接的蓝牙socket.





  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这是一组文档的第01个:Assigned Numbers.rar 这是我收集的蓝牙的全套文档,共计61个文件,如果以后再看到我会继续添加到这里来。 这一组供下载的文件如下: 序号 文件名 文件大小 01 Assigned Numbers.rar 368,394 02 Core spec.rar 316,003 03 Core_v210_EDR.zip 7,553,296 04 Core_V21__EDR.zip 8,677,223 05 Core_V30__HS.zip 10,441,289 06 Core_V40.zip 10,040,698 07 Profile Spec.rar 11,987,908 08 Protocol Spec.rar 4,247,516 09 Qualification Program.rar 1,901,186 我的文档的目录结构如下(其中Core部分太大,由于csdn上传大小限制被分开了Core_开头的4 个文件是在目录“Core spec”下): MyDocDir 的目录 2010-01-08 09:59 . 2010-01-08 09:59 .. 2010-01-08 09:53 Assigned Numbers 2010-01-08 09:56 Core spec 2010-01-08 09:53 Profile Spec 2010-01-08 09:53 Protocol Spec 2010-01-08 09:53 Qualification Program MyDocDir\Assigned Numbers 的目录 2010-01-08 09:53 . 2010-01-08 09:53 .. 2010-01-06 09:48 18,472 AssignedNumbersAMPManagerProtocol.pdf 2010-01-06 09:48 77,466 AssignedNumbersBaseband.pdf 2010-01-06 09:48 90,242 AssignedNumbersCompanyIdentifiers.pdf 2010-01-06 09:48 23,199 AssignedNumbersGenericAccessProfile.pdf 2010-01-06 09:48 19,379 AssignedNumbersHostControllerInterface1.pdf 2010-01-06 09:48 114,612 AssignedNumbersHostOperatingEnvironment.pdf 2010-01-06 09:48 19,850 AssignedNumbersLinkManager1.pdf 2010-01-06 09:48 29,516 AssignedNumbersLogicalLinkControl.pdf 2010-01-06 09:48 69,943 AssignedNumbersOverview.pdf 2010-01-06 09:48 16,541 AssignedNumbersProtocolAdaptationLayer.pdf 2010-01-06 09:48 55,713 AssignedNumbersServiceDiscovery.pdf 11 个文件 534,933 字节 MyDocDir\Core spec 的目录 2010-01-08 09:56 . 2010-01-08 09:56
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值