`
地球小野花
  • 浏览: 161702 次
  • 性别: Icon_minigender_1
  • 来自: 马赛大回旋
社区版块
存档分类
最新评论

Android源码 Bluetooth设置的类说明

阅读更多

Android应用程序(Setting)中有关蓝牙设定部分的相关类

 

在Android Setting App中中,蓝牙功能的设定是如何定义了如下相关类,它们的意义和作用分别为:

 

BluetoothSettings is the Settings screen for Bluetooth configuration and connection management.

 

BluetoothDevicePreference is the preference type used to display each remote Bluetooth device in the Bluetooth Settings screen.

 

BluetoothDiscoverableEnabler is a helper to manage the “Discoverable” checkbox. It sets/unsets discoverability and keeps track of how much time until the the discoverability is automatically turned off.

 

BluetoothEnabler is a helper to manage the Bluetooth on/off checkbox preference. It is turns on/off Bluetooth and ensures the summary of the preference reflects the current state.

 

BluetoothEventRedirector receives broadcasts and callbacks from the Bluetooth API and dispatches the event on the UI thread to the right class in the Settings. 

 

BluetoothNamePreference is the preference type for editing the device’s Bluetooth name. It asks the user for a name, and persists it via the Bluetooth API.

 

BluetoothPinDialog asks the user to enter a PIN for pairing with a remote Bluetooth device. It is an activity that appears as a dialog.

 

BluetoothPinRequest is a receiver for any Bluetooth pairing PIN request. It checks if the Bluetooth Settings is currently visible and brings up the PIN entry dialog. Otherwise it puts a Notification in the status bar, which can be clicked to bring up the PIN entry dialog.

 

ConnectSpecificProfilesActivity presents the user with all of the profiles for a particular device, and allows him to choose which should be connected (or disconnected).


 

LocalBluetoothDevice represents a remote Bluetooth device. It contains attributes of the device (such as the address, name, RSSI, etc.) and functionality that can be performed on the device (connect, pair, disconnect, etc.).


LocalBluetoothDeviceManager manages the set of remote Bluetooth devices.

 

LocalBluetoothManager provides a simplified interface on top of a subset of the Bluetooth API.

 

LocalBluetoothProfileManager is an abstract class defining the basic functionality related to a profile.

 

SettingsBtStatus is a helper class that contains constants for various status codes.

 

Framework realted

AtCommandHandler is handler interface for AtParser.

 

AtCommandResult represent the final response to an AT command line, and also  intermediate responses to a single command within a chained AT command line.

 

AtParser object accepts a new command line to parse via its process() method. It breaks each command line into one or more commands. Each command is parsed for name, type, and (optional) arguments, and an appropriate external handler method is called through the AtCommandHandler interface.

 

BluetoothCmeError: Constants for extended AT error codes specified by the Handsfree profile.

 

BluetoothAtPhonebook is helper for managing phonebook presentation over AT commands

 

BluetoothA2dp is a proxy object for controlling the Bluetooth A2DP Service via IPC. Currently this class provides methods to connect to A2DP audio sinks.

 

BluetoothA2dpService

 

BluetoothAudioGateway listen’s for incoming RFCOMM connection for the headset / handsfree service.  This class is planned for deletion, in favor of a generic Rfcomm class.

 

BluetoothClass is static helper methods and constants to decode the device class bit vector returned by the Bluetooth API.

 

BluetoothDevice manages the local Bluetooth device. Scan for devices, create bondings, power up and down the adapter.

 

BluetoothDeviceService

 

BluetoothError: constant error codes

 

BluetoothEventLoop

 

BluetoothHeadset is public API for controlling the Bluetooth Headset Service. This includes both Bluetooth Headset and Handsfree (v1.5) profiles. The Headset service will  attempt a handsfree connection first, and fall back to headset.

 

BluetoothHandsfree: Bluetooth headset manager for the Phone app.

 

BluetoothHeadsetService extends Service, provides Bluetooth Headset and Handsfree profile, as a service in the Phone application.

 

BluetoothIntent contains constant intens for bluetooth.

 

Database is A low-level API to the Service Discovery Protocol (SDP) Database.

 

HeadsetBase is the base RFCOMM (service) connection for a headset or handsfree device.

 

RfcommSocket implements an API to the Bluetooth RFCOMM layer. An RFCOMM socket  is similar to a normal socket in that it takes an address and a port number. The difference is of course that the address is a Bluetooth-device address, and the port number is an RFCOMM channel.

 

ScoSocket: Simple SCO Socket. Currently in Android, there is no support for sending data over a SCO socket – this is managed by the hardware link to the Bluetooth Chip. This class is instead intended for management of the SCO socket lifetime,  and is tailored for use with the headset / handsfree profiles.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics