2 EFI Bluetooth Configuration Protocol as defined in UEFI 2.5.
3 This protocol abstracts user interface configuration for Bluetooth device.
5 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 @par Revision Reference:
15 This Protocol is introduced in UEFI Specification 2.5
19 #ifndef __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__
20 #define __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__
22 #include <IndustryStandard/Bluetooth.h>
24 #define EFI_BLUETOOTH_CONFIG_PROTOCOL_GUID \
26 0x62960cf3, 0x40ff, 0x4263, { 0xa7, 0x7c, 0xdf, 0xde, 0xbd, 0x19, 0x1b, 0x4b } \
29 typedef struct _EFI_BLUETOOTH_CONFIG_PROTOCOL EFI_BLUETOOTH_CONFIG_PROTOCOL
;
31 typedef UINT32 EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE
;
32 #define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_CONNECTED 0x1
33 #define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_PAIRED 0x2
36 /// EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION
40 /// 48bit Bluetooth device address.
42 BLUETOOTH_ADDRESS BDAddr
;
44 /// State of the remote deive
46 UINT8 RemoteDeviceState
;
48 /// Bluetooth ClassOfDevice. See Bluetooth specification for detail.
50 BLUETOOTH_CLASS_OF_DEVICE ClassOfDevice
;
52 /// Remote device name
54 UINT8 RemoteDeviceName
[BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE
];
55 } EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION
;
58 /// EFI_BLUETOOTH_CONFIG_DATA_TYPE
62 /// Local/Remote Bluetooth device name. Data structure is zero terminated CHAR8[].
64 EfiBluetoothConfigDataTypeDeviceName
,
66 /// Local/Remote Bluetooth device ClassOfDevice. Data structure is BLUETOOTH_CLASS_OF_DEVICE.
68 EfiBluetoothConfigDataTypeClassOfDevice
,
70 /// Remote Bluetooth device state. Data structure is EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE.
72 EfiBluetoothConfigDataTypeRemoteDeviceState
,
74 /// Local/Remote Bluetooth device SDP information. Data structure is UINT8[].
76 EfiBluetoothConfigDataTypeSdpInfo
,
78 /// Local Bluetooth device address. Data structure is BLUETOOTH_ADDRESS.
80 EfiBluetoothConfigDataTypeBDADDR
,
82 /// Local Bluetooth discoverable state. Data structure is UINT8. (Page scan and/or Inquiry scan)
84 EfiBluetoothConfigDataTypeDiscoverable
,
86 /// Local Bluetooth controller stored paired device list. Data structure is BLUETOOTH_ADDRESS[].
88 EfiBluetoothConfigDataTypeControllerStoredPairedDeviceList
,
90 /// Local available device list. Data structure is BLUETOOTH_ADDRESS[].
92 EfiBluetoothConfigDataTypeAvailableDeviceList
,
93 EfiBluetoothConfigDataTypeMax
,
94 } EFI_BLUETOOTH_CONFIG_DATA_TYPE
;
97 /// EFI_BLUETOOTH_PIN_CALLBACK_TYPE.
101 /// For SSP - passkey entry. Input buffer is Passkey (4 bytes). No output buffer.
102 /// See Bluetooth HCI command for detail.
104 EfiBluetoothCallbackTypeUserPasskeyNotification
,
106 /// For SSP - just work and numeric comparison. Input buffer is numeric value (4 bytes).
107 /// Output buffer is BOOLEAN (1 byte). See Bluetooth HCI command for detail.
109 EfiBluetoothCallbackTypeUserConfirmationRequest
,
111 /// For SSP - OOB. See Bluetooth HCI command for detail.
113 EfiBluetoothCallbackTypeOOBDataRequest
,
115 /// For legacy paring. No input buffer. Output buffer is PIN code( <= 16 bytes).
116 /// See Bluetooth HCI command for detail.
118 EfiBluetoothCallbackTypePinCodeRequest
,
119 EfiBluetoothCallbackTypeMax
120 } EFI_BLUETOOTH_PIN_CALLBACK_TYPE
;
123 /// EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
127 /// This callback is called when Bluetooth receive Disconnection_Complete event. Input buffer is Event
128 /// Parameters of Disconnection_Complete Event defined in Bluetooth specification.
130 EfiBluetoothConnCallbackTypeDisconnected
,
132 /// This callback is called when Bluetooth receive Connection_Complete event. Input buffer is Event
133 /// Parameters of Connection_Complete Event defined in Bluetooth specification.
135 EfiBluetoothConnCallbackTypeConnected
,
137 /// This callback is called when Bluetooth receive Authentication_Complete event. Input buffer is Event
138 /// Parameters of Authentication_Complete Event defined in Bluetooth specification.
140 EfiBluetoothConnCallbackTypeAuthenticated
,
142 /// This callback is called when Bluetooth receive Encryption_Change event. Input buffer is Event
143 /// Parameters of Encryption_Change Event defined in Bluetooth specification.
145 EfiBluetoothConnCallbackTypeEncrypted
146 } EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE
;
150 Initialize Bluetooth host controller and local device.
152 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
154 @retval EFI_SUCCESS The Bluetooth host controller and local device is initialized successfully.
155 @retval EFI_DEVICE_ERROR A hardware error occurred trying to initialize the Bluetooth host controller
161 (EFIAPI
*EFI_BLUETOOTH_CONFIG_INIT
)(
162 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
166 Callback function, it is called if a Bluetooth device is found during scan process.
168 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
169 @param Context Context passed from scan request.
170 @param CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.
172 @retval EFI_SUCCESS The callback function complete successfully.
177 (EFIAPI
*EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION
) (
178 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
180 IN EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION
*CallbackInfo
184 Scan Bluetooth device.
186 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
187 @param ReScan If TRUE, a new scan request is submitted no matter there is scan result before.
188 If FALSE and there is scan result, the previous scan result is returned and no scan request
190 @param ScanType Bluetooth scan type, Inquiry and/or Page. See Bluetooth specification for detail.
191 @param Callback The callback function. This function is called if a Bluetooth device is found during scan
193 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
195 @retval EFI_SUCCESS The Bluetooth scan request is submitted.
196 @retval EFI_DEVICE_ERROR A hardware error occurred trying to scan the Bluetooth device.
201 (EFIAPI
*EFI_BLUETOOTH_CONFIG_SCAN
)(
202 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
205 IN EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION Callback
,
210 Connect a Bluetooth device.
212 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
213 @param BD_ADDR The address of Bluetooth device to be connected.
215 @retval EFI_SUCCESS The Bluetooth device is connected successfully.
216 @retval EFI_ALREADY_STARTED The Bluetooth device is already connected.
217 @retval EFI_NOT_FOUND The Bluetooth device is not found.
218 @retval EFI_DEVICE_ERROR A hardware error occurred trying to connect the Bluetooth device.
223 (EFIAPI
*EFI_BLUETOOTH_CONFIG_CONNECT
)(
224 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
225 IN BLUETOOTH_ADDRESS
*BD_ADDR
229 Disconnect a Bluetooth device.
231 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
232 @param BD_ADDR The address of Bluetooth device to be connected.
233 @param Reason Bluetooth disconnect reason. See Bluetooth specification for detail.
235 @retval EFI_SUCCESS The Bluetooth device is disconnected successfully.
236 @retval EFI_NOT_STARTED The Bluetooth device is not connected.
237 @retval EFI_NOT_FOUND The Bluetooth device is not found.
238 @retval EFI_DEVICE_ERROR A hardware error occurred trying to disconnect the Bluetooth device.
243 (EFIAPI
*EFI_BLUETOOTH_CONFIG_DISCONNECT
)(
244 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
245 IN BLUETOOTH_ADDRESS
*BD_ADDR
,
250 Get Bluetooth configuration data.
252 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
253 @param DataType Configuration data type.
254 @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
255 On output, indicates the amount of data actually returned.
256 @param Data A pointer to the buffer of data that will be returned.
258 @retval EFI_SUCCESS The Bluetooth configuration data is returned successfully.
259 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
263 @retval EFI_UNSUPPORTED The DataType is unsupported.
264 @retval EFI_NOT_FOUND The DataType is not found.
265 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
270 (EFIAPI
*EFI_BLUETOOTH_CONFIG_GET_DATA
)(
271 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
272 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType
,
273 IN OUT UINTN
*DataSize
,
278 Set Bluetooth configuration data.
280 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
281 @param DataType Configuration data type.
282 @param DataSize Indicates the size, in bytes, of the data buffer specified by Data.
283 @param Data A pointer to the buffer of data that will be set.
285 @retval EFI_SUCCESS The Bluetooth configuration data is set successfully.
286 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
289 @retval EFI_UNSUPPORTED The DataType is unsupported.
290 @retval EFI_BUFFER_TOO_SMALL Cannot set configuration data.
295 (EFIAPI
*EFI_BLUETOOTH_CONFIG_SET_DATA
)(
296 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
297 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType
,
303 Get remove Bluetooth device configuration data.
305 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
306 @param DataType Configuration data type.
307 @param BDAddr Remote Bluetooth device address.
308 @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
309 On output, indicates the amount of data actually returned.
310 @param Data A pointer to the buffer of data that will be returned.
312 @retval EFI_SUCCESS The remote Bluetooth device configuration data is returned successfully.
313 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
317 @retval EFI_UNSUPPORTED The DataType is unsupported.
318 @retval EFI_NOT_FOUND The DataType is not found.
319 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
324 (EFIAPI
*EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA
)(
325 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
326 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType
,
327 IN BLUETOOTH_ADDRESS BDAddr
,
328 IN OUT UINTN
*DataSize
,
333 The callback function for PIN code.
335 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
336 @param Context Context passed from registration.
337 @param CallbackType Callback type in EFI_BLUETOOTH_PIN_CALLBACK_TYPE.
338 @param InputBuffer A pointer to the buffer of data that is input from callback caller.
339 @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
340 @param OutputBuffer A pointer to the buffer of data that will be output from callback callee.
341 Callee allocates this buffer by using EFI Boot Service AllocatePool().
342 @param OutputBufferSize Indicates the size, in bytes, of the data buffer specified by OutputBuffer.
344 @retval EFI_SUCCESS The callback function complete successfully.
349 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION
)(
350 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
352 IN EFI_BLUETOOTH_PIN_CALLBACK_TYPE CallbackType
,
353 IN VOID
*InputBuffer
,
354 IN UINTN InputBufferSize
,
355 OUT VOID
**OutputBuffer
,
356 OUT UINTN
*OutputBufferSize
360 Register PIN callback function.
362 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
363 @param Callback The callback function. NULL means unregister.
364 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
366 @retval EFI_SUCCESS The PIN callback function is registered successfully.
371 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK
)(
372 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
373 IN EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION Callback
,
378 The callback function to get link key.
380 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
381 @param Context Context passed from registration.
382 @param BDAddr A pointer to Bluetooth device address.
383 @param LinkKey A pointer to the buffer of link key.
385 @retval EFI_SUCCESS The callback function complete successfully.
390 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION
)(
391 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
393 IN BLUETOOTH_ADDRESS
*BDAddr
,
394 OUT UINT8 LinkKey
[BLUETOOTH_HCI_LINK_KEY_SIZE
]
398 Register get link key callback function.
400 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
401 @param Callback The callback function. NULL means unregister.
402 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
404 @retval EFI_SUCCESS The link key callback function is registered successfully.
409 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK
)(
410 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
411 IN EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION Callback
,
416 The callback function to set link key.
418 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
419 @param Context Context passed from registration.
420 @param BDAddr A pointer to Bluetooth device address.
421 @param LinkKey A pointer to the buffer of link key.
423 @retval EFI_SUCCESS The callback function complete successfully.
428 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION
)(
429 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
431 IN BLUETOOTH_ADDRESS
*BDAddr
,
432 IN UINT8 LinkKey
[BLUETOOTH_HCI_LINK_KEY_SIZE
]
436 Register set link key callback function.
438 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
439 @param Callback The callback function. NULL means unregister.
440 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
442 @retval EFI_SUCCESS The link key callback function is registered successfully.
447 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK
)(
448 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
449 IN EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION Callback
,
454 The callback function. It is called after connect completed.
456 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
457 @param Context Context passed from registration.
458 @param CallbackType Callback type in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
459 @param BDAddr A pointer to Bluetooth device address.
460 @param InputBuffer A pointer to the buffer of data that is input from callback caller.
461 @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
463 @retval EFI_SUCCESS The callback function complete successfully.
468 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION
)(
469 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
471 IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType
,
472 IN BLUETOOTH_ADDRESS
*BDAddr
,
473 IN VOID
*InputBuffer
,
474 IN UINTN InputBufferSize
478 Register link connect complete callback function.
480 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
481 @param Callback The callback function. NULL means unregister.
482 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
484 @retval EFI_SUCCESS The link connect complete callback function is registered successfully.
489 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK
)(
490 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
491 IN EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION Callback
,
496 /// This protocol abstracts user interface configuration for Bluetooth device.
498 struct _EFI_BLUETOOTH_CONFIG_PROTOCOL
{
499 EFI_BLUETOOTH_CONFIG_INIT Init
;
500 EFI_BLUETOOTH_CONFIG_SCAN Scan
;
501 EFI_BLUETOOTH_CONFIG_CONNECT Connect
;
502 EFI_BLUETOOTH_CONFIG_DISCONNECT Disconnect
;
503 EFI_BLUETOOTH_CONFIG_GET_DATA GetData
;
504 EFI_BLUETOOTH_CONFIG_SET_DATA SetData
;
505 EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA GetRemoteData
;
506 EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK RegisterPinCallback
;
507 EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK RegisterGetLinkKeyCallback
;
508 EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK RegisterSetLinkKeyCallback
;
509 EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkConnectCompleteCallback
;
512 extern EFI_GUID gEfiBluetoothConfigProtocolGuid
;