2 EFI Bluetooth Configuration Protocol as defined in UEFI 2.7.
3 This protocol abstracts user interface configuration for Bluetooth device.
5 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
8 @par Revision Reference:
9 This Protocol is introduced in UEFI Specification 2.7
13 #ifndef __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__
14 #define __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__
16 #include <IndustryStandard/Bluetooth.h>
18 #define EFI_BLUETOOTH_CONFIG_PROTOCOL_GUID \
20 0x62960cf3, 0x40ff, 0x4263, { 0xa7, 0x7c, 0xdf, 0xde, 0xbd, 0x19, 0x1b, 0x4b } \
23 typedef struct _EFI_BLUETOOTH_CONFIG_PROTOCOL EFI_BLUETOOTH_CONFIG_PROTOCOL
;
25 typedef UINT32 EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE
;
26 #define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_CONNECTED 0x1
27 #define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_PAIRED 0x2
30 /// EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION
34 /// 48bit Bluetooth device address.
36 BLUETOOTH_ADDRESS BDAddr
;
38 /// State of the remote deive
40 UINT8 RemoteDeviceState
;
42 /// Bluetooth ClassOfDevice. See Bluetooth specification for detail.
44 BLUETOOTH_CLASS_OF_DEVICE ClassOfDevice
;
46 /// Remote device name
48 UINT8 RemoteDeviceName
[BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE
];
49 } EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION
;
52 /// EFI_BLUETOOTH_CONFIG_DATA_TYPE
56 /// Local/Remote Bluetooth device name. Data structure is zero terminated CHAR8[].
58 EfiBluetoothConfigDataTypeDeviceName
,
60 /// Local/Remote Bluetooth device ClassOfDevice. Data structure is BLUETOOTH_CLASS_OF_DEVICE.
62 EfiBluetoothConfigDataTypeClassOfDevice
,
64 /// Remote Bluetooth device state. Data structure is EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE.
66 EfiBluetoothConfigDataTypeRemoteDeviceState
, /* Relevant for LE*/
68 /// Local/Remote Bluetooth device SDP information. Data structure is UINT8[].
70 EfiBluetoothConfigDataTypeSdpInfo
,
72 /// Local Bluetooth device address. Data structure is BLUETOOTH_ADDRESS.
74 EfiBluetoothConfigDataTypeBDADDR
, /* Relevant for LE*/
76 /// Local Bluetooth discoverable state. Data structure is UINT8. (Page scan and/or Inquiry scan)
78 EfiBluetoothConfigDataTypeDiscoverable
, /* Relevant for LE*/
80 /// Local Bluetooth controller stored paired device list. Data structure is BLUETOOTH_ADDRESS[].
82 EfiBluetoothConfigDataTypeControllerStoredPairedDeviceList
,
84 /// Local available device list. Data structure is BLUETOOTH_ADDRESS[].
86 EfiBluetoothConfigDataTypeAvailableDeviceList
,
87 EfiBluetoothConfigDataTypeRandomAddress
, /* Relevant for LE*/
88 EfiBluetoothConfigDataTypeRSSI
, /* Relevant for LE*/
90 /// Advertisement report. Data structure is UNIT8[].
92 EfiBluetoothConfigDataTypeAdvertisementData
, /* Relevant for LE*/
93 EfiBluetoothConfigDataTypeIoCapability
, /* Relevant for LE*/
94 EfiBluetoothConfigDataTypeOOBDataFlag
, /* Relevant for LE*/
96 /// KeyType of Authentication Requirements flag of local
97 /// device as UINT8, indicating requested security properties.
98 /// See Bluetooth specification 3.H.3.5.1. BIT0: MITM, BIT1:SC.
100 EfiBluetoothConfigDataTypeKeyType
, /* Relevant for LE*/
101 EfiBluetoothConfigDataTypeEncKeySize
, /* Relevant for LE*/
102 EfiBluetoothConfigDataTypeMax
,
103 } EFI_BLUETOOTH_CONFIG_DATA_TYPE
;
106 /// EFI_BLUETOOTH_PIN_CALLBACK_TYPE.
110 /// For SSP - passkey entry. Input buffer is Passkey (4 bytes). No output buffer.
111 /// See Bluetooth HCI command for detail.
113 EfiBluetoothCallbackTypeUserPasskeyNotification
,
115 /// For SSP - just work and numeric comparison. Input buffer is numeric value (4 bytes).
116 /// Output buffer is BOOLEAN (1 byte). See Bluetooth HCI command for detail.
118 EfiBluetoothCallbackTypeUserConfirmationRequest
,
120 /// For SSP - OOB. See Bluetooth HCI command for detail.
122 EfiBluetoothCallbackTypeOOBDataRequest
,
124 /// For legacy paring. No input buffer. Output buffer is PIN code( <= 16 bytes).
125 /// See Bluetooth HCI command for detail.
127 EfiBluetoothCallbackTypePinCodeRequest
,
128 EfiBluetoothCallbackTypeMax
129 } EFI_BLUETOOTH_PIN_CALLBACK_TYPE
;
132 /// EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
136 /// This callback is called when Bluetooth receive Disconnection_Complete event. Input buffer is Event
137 /// Parameters of Disconnection_Complete Event defined in Bluetooth specification.
139 EfiBluetoothConnCallbackTypeDisconnected
,
141 /// This callback is called when Bluetooth receive Connection_Complete event. Input buffer is Event
142 /// Parameters of Connection_Complete Event defined in Bluetooth specification.
144 EfiBluetoothConnCallbackTypeConnected
,
146 /// This callback is called when Bluetooth receive Authentication_Complete event. Input buffer is Event
147 /// Parameters of Authentication_Complete Event defined in Bluetooth specification.
149 EfiBluetoothConnCallbackTypeAuthenticated
,
151 /// This callback is called when Bluetooth receive Encryption_Change event. Input buffer is Event
152 /// Parameters of Encryption_Change Event defined in Bluetooth specification.
154 EfiBluetoothConnCallbackTypeEncrypted
155 } EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE
;
158 Initialize Bluetooth host controller and local device.
160 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
162 @retval EFI_SUCCESS The Bluetooth host controller and local device is initialized successfully.
163 @retval EFI_DEVICE_ERROR A hardware error occurred trying to initialize the Bluetooth host controller
169 (EFIAPI
*EFI_BLUETOOTH_CONFIG_INIT
)(
170 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
174 Callback function, it is called if a Bluetooth device is found during scan process.
176 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
177 @param Context Context passed from scan request.
178 @param CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.
180 @retval EFI_SUCCESS The callback function complete successfully.
185 (EFIAPI
*EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION
)(
186 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
188 IN EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION
*CallbackInfo
192 Scan Bluetooth device.
194 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
195 @param ReScan If TRUE, a new scan request is submitted no matter there is scan result before.
196 If FALSE and there is scan result, the previous scan result is returned and no scan request
198 @param ScanType Bluetooth scan type, Inquiry and/or Page. See Bluetooth specification for detail.
199 @param Callback The callback function. This function is called if a Bluetooth device is found during scan
201 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
203 @retval EFI_SUCCESS The Bluetooth scan request is submitted.
204 @retval EFI_DEVICE_ERROR A hardware error occurred trying to scan the Bluetooth device.
209 (EFIAPI
*EFI_BLUETOOTH_CONFIG_SCAN
)(
210 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
213 IN EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION Callback
,
218 Connect a Bluetooth device.
220 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
221 @param BD_ADDR The address of Bluetooth device to be connected.
223 @retval EFI_SUCCESS The Bluetooth device is connected successfully.
224 @retval EFI_ALREADY_STARTED The Bluetooth device is already connected.
225 @retval EFI_NOT_FOUND The Bluetooth device is not found.
226 @retval EFI_DEVICE_ERROR A hardware error occurred trying to connect the Bluetooth device.
231 (EFIAPI
*EFI_BLUETOOTH_CONFIG_CONNECT
)(
232 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
233 IN BLUETOOTH_ADDRESS
*BD_ADDR
237 Disconnect a Bluetooth device.
239 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
240 @param BD_ADDR The address of Bluetooth device to be connected.
241 @param Reason Bluetooth disconnect reason. See Bluetooth specification for detail.
243 @retval EFI_SUCCESS The Bluetooth device is disconnected successfully.
244 @retval EFI_NOT_STARTED The Bluetooth device is not connected.
245 @retval EFI_NOT_FOUND The Bluetooth device is not found.
246 @retval EFI_DEVICE_ERROR A hardware error occurred trying to disconnect the Bluetooth device.
251 (EFIAPI
*EFI_BLUETOOTH_CONFIG_DISCONNECT
)(
252 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
253 IN BLUETOOTH_ADDRESS
*BD_ADDR
,
258 Get Bluetooth configuration data.
260 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
261 @param DataType Configuration data type.
262 @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
263 On output, indicates the amount of data actually returned.
264 @param Data A pointer to the buffer of data that will be returned.
266 @retval EFI_SUCCESS The Bluetooth configuration data is returned successfully.
267 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
269 - *DataSize is not 0 and Data is NULL.
270 @retval EFI_UNSUPPORTED The DataType is unsupported.
271 @retval EFI_NOT_FOUND The DataType is not found.
272 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
273 *DataSize has been updated with the size needed to complete the request.
278 (EFIAPI
*EFI_BLUETOOTH_CONFIG_GET_DATA
)(
279 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
280 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType
,
281 IN OUT UINTN
*DataSize
,
286 Set Bluetooth configuration data.
288 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
289 @param DataType Configuration data type.
290 @param DataSize Indicates the size, in bytes, of the data buffer specified by Data.
291 @param Data A pointer to the buffer of data that will be set.
293 @retval EFI_SUCCESS The Bluetooth configuration data is set successfully.
294 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
297 @retval EFI_UNSUPPORTED The DataType is unsupported.
298 @retval EFI_BUFFER_TOO_SMALL Cannot set configuration data.
303 (EFIAPI
*EFI_BLUETOOTH_CONFIG_SET_DATA
)(
304 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
305 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType
,
311 Get remove Bluetooth device configuration data.
313 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
314 @param DataType Configuration data type.
315 @param BDAddr Remote Bluetooth device address.
316 @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
317 On output, indicates the amount of data actually returned.
318 @param Data A pointer to the buffer of data that will be returned.
320 @retval EFI_SUCCESS The remote Bluetooth device configuration data is returned successfully.
321 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
323 - *DataSize is not 0 and Data is NULL.
324 @retval EFI_UNSUPPORTED The DataType is unsupported.
325 @retval EFI_NOT_FOUND The DataType is not found.
326 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
327 *DataSize has been updated with the size needed to complete the request.
332 (EFIAPI
*EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA
)(
333 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
334 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType
,
335 IN BLUETOOTH_ADDRESS
*BDAddr
,
336 IN OUT UINTN
*DataSize
,
341 The callback function for PIN code.
343 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
344 @param Context Context passed from registration.
345 @param CallbackType Callback type in EFI_BLUETOOTH_PIN_CALLBACK_TYPE.
346 @param InputBuffer A pointer to the buffer of data that is input from callback caller.
347 @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
348 @param OutputBuffer A pointer to the buffer of data that will be output from callback callee.
349 Callee allocates this buffer by using EFI Boot Service AllocatePool().
350 @param OutputBufferSize Indicates the size, in bytes, of the data buffer specified by OutputBuffer.
352 @retval EFI_SUCCESS The callback function complete successfully.
357 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION
)(
358 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
360 IN EFI_BLUETOOTH_PIN_CALLBACK_TYPE CallbackType
,
361 IN VOID
*InputBuffer
,
362 IN UINTN InputBufferSize
,
363 OUT VOID
**OutputBuffer
,
364 OUT UINTN
*OutputBufferSize
368 Register PIN callback function.
370 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
371 @param Callback The callback function. NULL means unregister.
372 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
374 @retval EFI_SUCCESS The PIN callback function is registered successfully.
379 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK
)(
380 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
381 IN EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION Callback
,
386 The callback function to get link key.
388 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
389 @param Context Context passed from registration.
390 @param BDAddr A pointer to Bluetooth device address.
391 @param LinkKey A pointer to the buffer of link key.
393 @retval EFI_SUCCESS The callback function complete successfully.
398 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION
)(
399 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
401 IN BLUETOOTH_ADDRESS
*BDAddr
,
402 OUT UINT8 LinkKey
[BLUETOOTH_HCI_LINK_KEY_SIZE
]
406 Register get link key callback function.
408 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
409 @param Callback The callback function. NULL means unregister.
410 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
412 @retval EFI_SUCCESS The link key callback function is registered successfully.
417 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK
)(
418 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
419 IN EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION Callback
,
424 The callback function to set link key.
426 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
427 @param Context Context passed from registration.
428 @param BDAddr A pointer to Bluetooth device address.
429 @param LinkKey A pointer to the buffer of link key.
431 @retval EFI_SUCCESS The callback function complete successfully.
436 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION
)(
437 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
439 IN BLUETOOTH_ADDRESS
*BDAddr
,
440 IN UINT8 LinkKey
[BLUETOOTH_HCI_LINK_KEY_SIZE
]
444 Register set link key callback function.
446 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
447 @param Callback The callback function. NULL means unregister.
448 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
450 @retval EFI_SUCCESS The link key callback function is registered successfully.
455 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK
)(
456 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
457 IN EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION Callback
,
462 The callback function. It is called after connect completed.
464 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
465 @param Context Context passed from registration.
466 @param CallbackType Callback type in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
467 @param BDAddr A pointer to Bluetooth device address.
468 @param InputBuffer A pointer to the buffer of data that is input from callback caller.
469 @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
471 @retval EFI_SUCCESS The callback function complete successfully.
476 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION
)(
477 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
479 IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType
,
480 IN BLUETOOTH_ADDRESS
*BDAddr
,
481 IN VOID
*InputBuffer
,
482 IN UINTN InputBufferSize
486 Register link connect complete callback function.
488 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
489 @param Callback The callback function. NULL means unregister.
490 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
492 @retval EFI_SUCCESS The link connect complete callback function is registered successfully.
497 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK
)(
498 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
499 IN EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION Callback
,
504 /// This protocol abstracts user interface configuration for Bluetooth device.
506 struct _EFI_BLUETOOTH_CONFIG_PROTOCOL
{
507 EFI_BLUETOOTH_CONFIG_INIT Init
;
508 EFI_BLUETOOTH_CONFIG_SCAN Scan
;
509 EFI_BLUETOOTH_CONFIG_CONNECT Connect
;
510 EFI_BLUETOOTH_CONFIG_DISCONNECT Disconnect
;
511 EFI_BLUETOOTH_CONFIG_GET_DATA GetData
;
512 EFI_BLUETOOTH_CONFIG_SET_DATA SetData
;
513 EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA GetRemoteData
;
514 EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK RegisterPinCallback
;
515 EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK RegisterGetLinkKeyCallback
;
516 EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK RegisterSetLinkKeyCallback
;
517 EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkConnectCompleteCallback
;
520 extern EFI_GUID gEfiBluetoothConfigProtocolGuid
;