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
;
159 Initialize Bluetooth host controller and local device.
161 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
163 @retval EFI_SUCCESS The Bluetooth host controller and local device is initialized successfully.
164 @retval EFI_DEVICE_ERROR A hardware error occurred trying to initialize the Bluetooth host controller
170 (EFIAPI
*EFI_BLUETOOTH_CONFIG_INIT
)(
171 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
175 Callback function, it is called if a Bluetooth device is found during scan process.
177 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
178 @param Context Context passed from scan request.
179 @param CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.
181 @retval EFI_SUCCESS The callback function complete successfully.
186 (EFIAPI
*EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION
) (
187 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
189 IN EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION
*CallbackInfo
193 Scan Bluetooth device.
195 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
196 @param ReScan If TRUE, a new scan request is submitted no matter there is scan result before.
197 If FALSE and there is scan result, the previous scan result is returned and no scan request
199 @param ScanType Bluetooth scan type, Inquiry and/or Page. See Bluetooth specification for detail.
200 @param Callback The callback function. This function is called if a Bluetooth device is found during scan
202 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
204 @retval EFI_SUCCESS The Bluetooth scan request is submitted.
205 @retval EFI_DEVICE_ERROR A hardware error occurred trying to scan the Bluetooth device.
210 (EFIAPI
*EFI_BLUETOOTH_CONFIG_SCAN
)(
211 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
214 IN EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION Callback
,
219 Connect a Bluetooth device.
221 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
222 @param BD_ADDR The address of Bluetooth device to be connected.
224 @retval EFI_SUCCESS The Bluetooth device is connected successfully.
225 @retval EFI_ALREADY_STARTED The Bluetooth device is already connected.
226 @retval EFI_NOT_FOUND The Bluetooth device is not found.
227 @retval EFI_DEVICE_ERROR A hardware error occurred trying to connect the Bluetooth device.
232 (EFIAPI
*EFI_BLUETOOTH_CONFIG_CONNECT
)(
233 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
234 IN BLUETOOTH_ADDRESS
*BD_ADDR
238 Disconnect a Bluetooth device.
240 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
241 @param BD_ADDR The address of Bluetooth device to be connected.
242 @param Reason Bluetooth disconnect reason. See Bluetooth specification for detail.
244 @retval EFI_SUCCESS The Bluetooth device is disconnected successfully.
245 @retval EFI_NOT_STARTED The Bluetooth device is not connected.
246 @retval EFI_NOT_FOUND The Bluetooth device is not found.
247 @retval EFI_DEVICE_ERROR A hardware error occurred trying to disconnect the Bluetooth device.
252 (EFIAPI
*EFI_BLUETOOTH_CONFIG_DISCONNECT
)(
253 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
254 IN BLUETOOTH_ADDRESS
*BD_ADDR
,
259 Get Bluetooth configuration data.
261 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
262 @param DataType Configuration data type.
263 @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
264 On output, indicates the amount of data actually returned.
265 @param Data A pointer to the buffer of data that will be returned.
267 @retval EFI_SUCCESS The Bluetooth configuration data is returned successfully.
268 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
270 - *DataSize is not 0 and Data is NULL.
271 @retval EFI_UNSUPPORTED The DataType is unsupported.
272 @retval EFI_NOT_FOUND The DataType is not found.
273 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
274 *DataSize has been updated with the size needed to complete the request.
279 (EFIAPI
*EFI_BLUETOOTH_CONFIG_GET_DATA
)(
280 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
281 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType
,
282 IN OUT UINTN
*DataSize
,
287 Set Bluetooth configuration data.
289 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
290 @param DataType Configuration data type.
291 @param DataSize Indicates the size, in bytes, of the data buffer specified by Data.
292 @param Data A pointer to the buffer of data that will be set.
294 @retval EFI_SUCCESS The Bluetooth configuration data is set successfully.
295 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
298 @retval EFI_UNSUPPORTED The DataType is unsupported.
299 @retval EFI_BUFFER_TOO_SMALL Cannot set configuration data.
304 (EFIAPI
*EFI_BLUETOOTH_CONFIG_SET_DATA
)(
305 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
306 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType
,
312 Get remove Bluetooth device configuration data.
314 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
315 @param DataType Configuration data type.
316 @param BDAddr Remote Bluetooth device address.
317 @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
318 On output, indicates the amount of data actually returned.
319 @param Data A pointer to the buffer of data that will be returned.
321 @retval EFI_SUCCESS The remote Bluetooth device configuration data is returned successfully.
322 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
324 - *DataSize is not 0 and Data is NULL.
325 @retval EFI_UNSUPPORTED The DataType is unsupported.
326 @retval EFI_NOT_FOUND The DataType is not found.
327 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
328 *DataSize has been updated with the size needed to complete the request.
333 (EFIAPI
*EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA
)(
334 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
335 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType
,
336 IN BLUETOOTH_ADDRESS
*BDAddr
,
337 IN OUT UINTN
*DataSize
,
342 The callback function for PIN code.
344 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
345 @param Context Context passed from registration.
346 @param CallbackType Callback type in EFI_BLUETOOTH_PIN_CALLBACK_TYPE.
347 @param InputBuffer A pointer to the buffer of data that is input from callback caller.
348 @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
349 @param OutputBuffer A pointer to the buffer of data that will be output from callback callee.
350 Callee allocates this buffer by using EFI Boot Service AllocatePool().
351 @param OutputBufferSize Indicates the size, in bytes, of the data buffer specified by OutputBuffer.
353 @retval EFI_SUCCESS The callback function complete successfully.
358 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION
)(
359 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
361 IN EFI_BLUETOOTH_PIN_CALLBACK_TYPE CallbackType
,
362 IN VOID
*InputBuffer
,
363 IN UINTN InputBufferSize
,
364 OUT VOID
**OutputBuffer
,
365 OUT UINTN
*OutputBufferSize
369 Register PIN callback function.
371 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
372 @param Callback The callback function. NULL means unregister.
373 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
375 @retval EFI_SUCCESS The PIN callback function is registered successfully.
380 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK
)(
381 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
382 IN EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION Callback
,
387 The callback function to get link key.
389 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
390 @param Context Context passed from registration.
391 @param BDAddr A pointer to Bluetooth device address.
392 @param LinkKey A pointer to the buffer of link key.
394 @retval EFI_SUCCESS The callback function complete successfully.
399 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION
)(
400 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
402 IN BLUETOOTH_ADDRESS
*BDAddr
,
403 OUT UINT8 LinkKey
[BLUETOOTH_HCI_LINK_KEY_SIZE
]
407 Register get link key callback function.
409 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
410 @param Callback The callback function. NULL means unregister.
411 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
413 @retval EFI_SUCCESS The link key callback function is registered successfully.
418 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK
)(
419 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
420 IN EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION Callback
,
425 The callback function to set link key.
427 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
428 @param Context Context passed from registration.
429 @param BDAddr A pointer to Bluetooth device address.
430 @param LinkKey A pointer to the buffer of link key.
432 @retval EFI_SUCCESS The callback function complete successfully.
437 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION
)(
438 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
440 IN BLUETOOTH_ADDRESS
*BDAddr
,
441 IN UINT8 LinkKey
[BLUETOOTH_HCI_LINK_KEY_SIZE
]
445 Register set link key callback function.
447 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
448 @param Callback The callback function. NULL means unregister.
449 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
451 @retval EFI_SUCCESS The link key callback function is registered successfully.
456 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK
)(
457 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
458 IN EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION Callback
,
463 The callback function. It is called after connect completed.
465 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
466 @param Context Context passed from registration.
467 @param CallbackType Callback type in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
468 @param BDAddr A pointer to Bluetooth device address.
469 @param InputBuffer A pointer to the buffer of data that is input from callback caller.
470 @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
472 @retval EFI_SUCCESS The callback function complete successfully.
477 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION
)(
478 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
480 IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType
,
481 IN BLUETOOTH_ADDRESS
*BDAddr
,
482 IN VOID
*InputBuffer
,
483 IN UINTN InputBufferSize
487 Register link connect complete callback function.
489 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
490 @param Callback The callback function. NULL means unregister.
491 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
493 @retval EFI_SUCCESS The link connect complete callback function is registered successfully.
498 (EFIAPI
*EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK
)(
499 IN EFI_BLUETOOTH_CONFIG_PROTOCOL
*This
,
500 IN EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION Callback
,
505 /// This protocol abstracts user interface configuration for Bluetooth device.
507 struct _EFI_BLUETOOTH_CONFIG_PROTOCOL
{
508 EFI_BLUETOOTH_CONFIG_INIT Init
;
509 EFI_BLUETOOTH_CONFIG_SCAN Scan
;
510 EFI_BLUETOOTH_CONFIG_CONNECT Connect
;
511 EFI_BLUETOOTH_CONFIG_DISCONNECT Disconnect
;
512 EFI_BLUETOOTH_CONFIG_GET_DATA GetData
;
513 EFI_BLUETOOTH_CONFIG_SET_DATA SetData
;
514 EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA GetRemoteData
;
515 EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK RegisterPinCallback
;
516 EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK RegisterGetLinkKeyCallback
;
517 EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK RegisterSetLinkKeyCallback
;
518 EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkConnectCompleteCallback
;
521 extern EFI_GUID gEfiBluetoothConfigProtocolGuid
;