MdePkg[all]  1.08
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BluetoothLeConfig.h File Reference

Data Structures

struct  EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER
 
struct  EFI_BLUETOOTH_LE_SCAN_CALLBACK_INFORMATION
 
struct  EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER
 
struct  _EFI_BLUETOOTH_LE_CONFIG_PROTOCOL
 

Macros

#define EFI_BLUETOOTH_LE_CONFIG_PROTOCOL_GUID
 

Typedefs

typedef struct
_EFI_BLUETOOTH_LE_CONFIG_PROTOCOL 
EFI_BLUETOOTH_LE_CONFIG_PROTOCOL
 
typedef EFI_STATUS(EFIAPIEFI_BLUETOOTH_LE_CONFIG_INIT )(IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This)
 
typedef IN VOIDContext
 
typedef IN VOID IN
EFI_BLUETOOTH_LE_SCAN_CALLBACK_INFORMATION
CallbackInfo
 
typedef EFI_STATUS(EFIAPIEFI_BLUETOOTH_LE_CONFIG_SCAN )(IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, IN BOOLEAN ReScan, IN UINT32 Timeout, IN EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER *ScanParameter, IN EFI_BLUETOOTH_LE_CONFIG_SCAN_CALLBACK_FUNCTION Callback, IN VOID *Context)
 
typedef EFI_STATUS(EFIAPIEFI_BLUETOOTH_LE_CONFIG_CONNECT )(IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, IN BOOLEAN AutoReconnect, IN BOOLEAN DoBonding, IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER *ConnectParameter, IN BLUETOOTH_LE_ADDRESS *BD_ADDR)
 
typedef EFI_STATUS(EFIAPIEFI_BLUETOOTH_LE_CONFIG_DISCONNECT )(IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, IN BLUETOOTH_LE_ADDRESS *BD_ADDR, IN UINT8 Reason)
 
typedef IN
EFI_BLUETOOTH_CONFIG_DATA_TYPE 
DataType
 
typedef IN
EFI_BLUETOOTH_CONFIG_DATA_TYPE
IN OUT UINTN
DataSize
 
typedef IN
EFI_BLUETOOTH_CONFIG_DATA_TYPE
IN OUT UINTN IN OUT VOID
Data
 
typedef IN
EFI_BLUETOOTH_CONFIG_DATA_TYPE
IN BLUETOOTH_LE_ADDRESS
BDAddr
 
typedef IN VOID IN
BLUETOOTH_LE_ADDRESS IN
EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE 
EventDataType
 
typedef IN
EFI_BLUETOOTH_LE_SMP_CALLBACK 
Callback
 
typedef IN VOID IN
BLUETOOTH_LE_ADDRESS IN
EFI_BLUETOOTH_LE_SMP_DATA_TYPE 
Type
 
typedef IN VOID IN
EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE 
CallbackType
 
typedef IN VOID IN
EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE
IN BLUETOOTH_LE_ADDRESS IN
VOID
InputBuffer
 
typedef IN VOID IN
EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE
IN BLUETOOTH_LE_ADDRESS IN
VOID IN UINTN 
InputBufferSize
 

Enumerations

enum  EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE {
  EfiBluetoothSmpAuthorizationRequestEvent, EfiBluetoothSmpPasskeyReadyEvent, EfiBluetoothSmpPasskeyRequestEvent, EfiBluetoothSmpOOBDataRequestEvent,
  EfiBluetoothSmpNumericComparisonEvent
}
 
enum  EFI_BLUETOOTH_LE_SMP_DATA_TYPE {
  EfiBluetoothSmpLocalIR, EfiBluetoothSmpLocalER, EfiBluetoothSmpLocalDHK, EfiBluetoothSmpKeysDistributed = 0x1000,
  EfiBluetoothSmpKeySize, EfiBluetoothSmpKeyType, EfiBluetoothSmpPeerLTK, EfiBluetoothSmpPeerIRK,
  EfiBluetoothSmpPeerCSRK, EfiBluetoothSmpPeerRand, EfiBluetoothSmpPeerEDIV, EfiBluetoothSmpPeerSignCounter,
  EfiBluetoothSmpLocalLTK, EfiBluetoothSmpLocalIRK, EfiBluetoothSmpLocalCSRK, EfiBluetoothSmpLocalSignCounter,
  EfiBluetoothSmpLocalDIV, EfiBluetoothSmpPeerAddressList, EfiBluetoothSmpMax
}
 

Functions

typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SCAN_CALLBACK_FUNCTION)(IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This
 

Variables

EFI_GUID gEfiBluetoothLeConfigProtocolGuid
 

Detailed Description

EFI Bluetooth LE Config Protocol as defined in UEFI 2.7. This protocol abstracts user interface configuration for BluetoothLe device.

Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference:
This Protocol is introduced in UEFI Specification 2.7

Macro Definition Documentation

#define EFI_BLUETOOTH_LE_CONFIG_PROTOCOL_GUID
Value:
{ \
0x8f76da58, 0x1f99, 0x4275, { 0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c, 0xe8 } \
}

Typedef Documentation

typedef IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_COMPLETE_CALLBACK Callback
typedef IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_COMPLETE_CALLBACK IN VOID* Context
typedef EFI_STATUS(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_CONNECT)(IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, IN BOOLEAN AutoReconnect, IN BOOLEAN DoBonding, IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER *ConnectParameter, IN BLUETOOTH_LE_ADDRESS *BD_ADDR)

Connect a BluetoothLE device.

The Connect() function connects a Bluetooth device. When this function is returned successfully, a new EFI_BLUETOOTH_IO_PROTOCOL is created.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]AutoReconnectIf TRUE, the BluetoothLE host controller needs to do an auto reconnect. If FALSE, the BluetoothLE host controller does not do an auto reconnect.
[in]DoBondingIf TRUE, the BluetoothLE host controller needs to do a bonding. If FALSE, the BluetoothLE host controller does not do a bonding.
[in]ConnectParameterIf it is not NULL, the ConnectParameter is used to perform a scan by the BluetoothLE bus driver. If it is NULL, the default parameter is used.
[in]BD_ADDRThe address of the BluetoothLE device to be connected.
Return values
EFI_SUCCESSThe BluetoothLE device is connected successfully.
EFI_ALREADY_STARTEDThe BluetoothLE device is already connected.
EFI_NOT_FOUNDThe BluetoothLE device is not found.
EFI_DEVICE_ERRORA hardware error occurred trying to connect the BluetoothLE device.
typedef EFI_STATUS(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_DISCONNECT)(IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, IN BLUETOOTH_LE_ADDRESS *BD_ADDR, IN UINT8 Reason)

Disconnect a BluetoothLE device.

The Disconnect() function disconnects a BluetoothLE device. When this function is returned successfully, the EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL associated with this device is destroyed and all services associated are stopped.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]BD_ADDRThe address of BluetoothLE device to be connected.
[in]ReasonBluetooth disconnect reason. See Bluetooth specification for detail.
Return values
EFI_SUCCESSThe BluetoothLE device is disconnected successfully.
EFI_NOT_STARTEDThe BluetoothLE device is not connected.
EFI_NOT_FOUNDThe BluetoothLE device is not found.
EFI_DEVICE_ERRORA hardware error occurred trying to disconnect the BluetoothLE device.
typedef EFI_STATUS(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_INIT)(IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This)

Initialize BluetoothLE host controller and local device.

The Init() function initializes BluetoothLE host controller and local device.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
Return values
EFI_SUCCESSThe BluetoothLE host controller and local device is initialized successfully.
EFI_DEVICE_ERRORA hardware error occurred trying to initialize the BluetoothLE host controller and local device.
typedef EFI_STATUS(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_SCAN)(IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, IN BOOLEAN ReScan, IN UINT32 Timeout, IN EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER *ScanParameter, IN EFI_BLUETOOTH_LE_CONFIG_SCAN_CALLBACK_FUNCTION Callback, IN VOID *Context)

Scan BluetoothLE device.

The Scan() function scans BluetoothLE device. When this function is returned, it just means scan request is submitted. It does not mean scan process is started or finished. Whenever there is a BluetoothLE device is found, the Callback function will be called. Callback function might be called before this function returns or after this function returns

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]ReScanIf TRUE, a new scan request is submitted no matter there is scan result before. If FALSE and there is scan result, the previous scan result is returned and no scan request is submitted.
[in]TimeoutDuration in milliseconds for which to scan.
[in]ScanParameterIf it is not NULL, the ScanParameter is used to perform a scan by the BluetoothLE bus driver. If it is NULL, the default parameter is used.
[in]CallbackThe callback function. This function is called if a BluetoothLE device is found during scan process.
[in]ContextData passed into Callback function. This is optional parameter and may be NULL.
Return values
EFI_SUCCESSThe Bluetooth scan request is submitted.
EFI_DEVICE_ERRORA hardware error occurred trying to scan the BluetoothLE device.

Enumeration Type Documentation

Enumerator
EfiBluetoothSmpLocalIR 
EfiBluetoothSmpLocalER 
EfiBluetoothSmpLocalDHK 
EfiBluetoothSmpKeysDistributed 
EfiBluetoothSmpKeySize 
EfiBluetoothSmpKeyType 
EfiBluetoothSmpPeerLTK 
EfiBluetoothSmpPeerIRK 
EfiBluetoothSmpPeerCSRK 
EfiBluetoothSmpPeerRand 
EfiBluetoothSmpPeerEDIV 
EfiBluetoothSmpPeerSignCounter 
EfiBluetoothSmpLocalLTK 
EfiBluetoothSmpLocalIRK 
EfiBluetoothSmpLocalCSRK 
EfiBluetoothSmpLocalSignCounter 
EfiBluetoothSmpLocalDIV 
EfiBluetoothSmpPeerAddressList 
EfiBluetoothSmpMax 
Enumerator
EfiBluetoothSmpAuthorizationRequestEvent 

It indicates an authorization request. No data is associated with the callback input. In the output data, the application should return the authorization value. The data structure is BOOLEAN. TRUE means YES. FALSE means NO.

EfiBluetoothSmpPasskeyReadyEvent 

It indicates that a passkey has been generated locally by the driver, and the same passkey should be entered at the remote device. The callback input data is the passkey of type UINT32, to be displayed by the application. No output data should be returned.

EfiBluetoothSmpPasskeyRequestEvent 

It indicates that the driver is requesting for the passkey has been generated at the remote device. No data is associated with the callback input. The output data is the passkey of type UINT32, to be entered by the user.

EfiBluetoothSmpOOBDataRequestEvent 

It indicates that the driver is requesting for the passkey that has been pre-shared out-of-band with the remote device. No data is associated with the callback input. The output data is the stored OOB data of type UINT8[16].

EfiBluetoothSmpNumericComparisonEvent 

In indicates that a number have been generated locally by the bus driver, and also at the remote device, and the bus driver wants to know if the two numbers match. The callback input data is the number of type UINT32. The output data is confirmation value of type BOOLEAN. TRUE means comparison pass. FALSE means comparison fail.

Function Documentation

typedef EFI_STATUS ( EFIAPI EFI_BLUETOOTH_LE_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK)

Callback function, it is called if a BluetoothLE device is found during scan process.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]ContextContext passed from scan request.
[in]CallbackInfoData related to scan result. NULL CallbackInfo means scan complete.
Return values
EFI_SUCCESSThe callback function complete successfully.

Get BluetoothLE configuration data.

The GetData() function returns BluetoothLE configuration data. For remote BluetoothLE device configuration data, please use GetRemoteData() function with valid BD_ADDR.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]DataTypeConfiguration data type.
[in,out]DataSizeOn input, indicates the size, in bytes, of the data buffer specified by Data. On output, indicates the amount of data actually returned.
[in,out]DataA pointer to the buffer of data that will be returned.
Return values
EFI_SUCCESSThe BluetoothLE configuration data is returned successfully.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:
  • DataSize is NULL.
  • *DataSize is 0.
  • Data is NULL.
EFI_UNSUPPORTEDThe DataType is unsupported.
EFI_NOT_FOUNDThe DataType is not found.
EFI_BUFFER_TOO_SMALLThe buffer is too small to hold the buffer.

Set BluetoothLE configuration data.

The SetData() function sets local BluetoothLE device configuration data. Not all DataType can be set.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]DataTypeConfiguration data type.
[in]DataSizeIndicates the size, in bytes, of the data buffer specified by Data.
[in]DataA pointer to the buffer of data that will be set.
Return values
EFI_SUCCESSThe BluetoothLE configuration data is set successfully.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:
  • DataSize is 0.
  • Data is NULL.
EFI_UNSUPPORTEDThe DataType is unsupported.
EFI_WRITE_PROTECTEDCannot set configuration data.

Get remove BluetoothLE device configuration data.

The GetRemoteData() function returns remote BluetoothLE device configuration data.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]DataTypeConfiguration data type.
[in]BDAddrRemote BluetoothLE device address.
[in,out]DataSizeOn input, indicates the size, in bytes, of the data buffer specified by Data. On output, indicates the amount of data actually returned.
[in,out]DataA pointer to the buffer of data that will be returned.
Return values
EFI_SUCCESSThe remote BluetoothLE device configuration data is returned successfully.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:
  • DataSize is NULL.
  • *DataSize is 0.
  • Data is NULL.
EFI_UNSUPPORTEDThe DataType is unsupported.
EFI_NOT_FOUNDThe DataType is not found.
EFI_BUFFER_TOO_SMALLThe buffer is too small to hold the buffer.

The callback function for SMP.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]ContextData passed into callback function. This is optional parameter and may be NULL.
[in]BDAddrRemote BluetoothLE device address.
[in]EventDataTypeEvent data type in EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE.
[in]DataSizeIndicates the size, in bytes, of the data buffer specified by Data.
[in]DataA pointer to the buffer of data.
Return values
EFI_SUCCESSThe callback function complete successfully.

Register Security Manager Protocol callback function for user authentication/authorization.

The RegisterSmpAuthCallback() function register Security Manager Protocol callback function for user authentication/authorization.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]CallbackCallback function for user authentication/authorization.
[in]ContextData passed into Callback function. This is optional parameter and may be NULL.
Return values
EFI_SUCCESSThe SMP callback function is registered successfully.
EFI_ALREADY_STARTEDA callback function is already registered on the same attribute opcode and attribute handle, when the Callback is not NULL.
EFI_NOT_STARTEDA callback function is not registered on the same attribute opcode and attribute handle, when the Callback is NULL.

Send user authentication/authorization to remote device.

The SendSmpAuthData() function sends user authentication/authorization to remote device. It should be used to send these information after the caller gets the request data from the callback function by RegisterSmpAuthCallback().

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]BDAddrRemote BluetoothLE device address.
[in]EventDataTypeEvent data type in EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE.
[in]DataSizeThe size of Data in bytes, of the data buffer specified by Data.
[in]DataA pointer to the buffer of data that will be sent. The data format depends on the type of SMP event data being responded to.
Return values
EFI_SUCCESSThe SMP authorization data is sent successfully.
EFI_NOT_READYSMP is not in the correct state to receive the auth data.

The callback function to get SMP data.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]ContextData passed into callback function. This is optional parameter and may be NULL.
[in]BDAddrRemote BluetoothLE device address. For Local device setting, it should be NULL.
[in]DataTypeData type in EFI_BLUETOOTH_LE_SMP_DATA_TYPE.
[in,out]DataSizeOn input, indicates the size, in bytes, of the data buffer specified by Data. On output, indicates the amount of data actually returned.
[out]DataA pointer to the buffer of data that will be returned.
Return values
EFI_SUCCESSThe callback function complete successfully.

Register a callback function to get SMP related data.

The RegisterSmpGetDataCallback() function registers a callback function to get SMP related data.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]CallbackCallback function for SMP get data.
[in]ContextData passed into Callback function. This is optional parameter and may be NULL.
Return values
EFI_SUCCESSThe SMP get data callback function is registered successfully.
EFI_ALREADY_STARTEDA callback function is already registered on the same attribute opcode and attribute handle, when the Callback is not NULL.
EFI_NOT_STARTEDA callback function is not registered on the same attribute opcode and attribute handle, when the Callback is NULL

The callback function to set SMP data.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]ContextData passed into callback function. This is optional parameter and may be NULL.
[in]BDAddrRemote BluetoothLE device address.
[in]DataTypeData type in EFI_BLUETOOTH_LE_SMP_DATA_TYPE.
[in]DataSizeIndicates the size, in bytes, of the data buffer specified by Data.
[in]DataA pointer to the buffer of data.
Return values
EFI_SUCCESSThe callback function complete successfully.

Register a callback function to set SMP related data.

The RegisterSmpSetDataCallback() function registers a callback function to set SMP related data.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]CallbackCallback function for SMP set data.
[in]ContextData passed into Callback function. This is optional parameter and may be NULL.
Return values
EFI_SUCCESSThe SMP set data callback function is registered successfully.
EFI_ALREADY_STARTEDA callback function is already registered on the same attribute opcode and attribute handle, when the Callback is not NULL.
EFI_NOT_STARTEDA callback function is not registered on the same attribute opcode and attribute handle, when the Callback is NULL

The callback function to hook connect complete event.

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]ContextData passed into callback function. This is optional parameter and may be NULL.
[in]CallbackTypeThe value defined in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
[in]BDAddrRemote BluetoothLE device address.
[in]InputBufferA pointer to the buffer of data that is input from callback caller.
[in]InputBufferSizeIndicates the size, in bytes, of the data buffer specified by InputBuffer.
Return values
EFI_SUCCESSThe callback function complete successfully.

Register link connect complete callback function.

The RegisterLinkConnectCompleteCallback() function registers Bluetooth link connect complete callback function. The Bluetooth Configuration driver may call RegisterLinkConnectCompleteCallback() to register a callback function. During pairing, Bluetooth bus driver must trigger this callback function to report device state, if it is registered. Then Bluetooth Configuration driver will get information on device connection, according to CallbackType defined by EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE

Parameters
[in]ThisPointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.
[in]CallbackThe callback function. NULL means unregister.
[in]ContextData passed into Callback function. This is optional parameter and may be NULL.
Return values
EFI_SUCCESSThe link connect complete callback function is registered successfully.
EFI_ALREADY_STARTEDA callback function is already registered on the same attribute opcode and attribute handle, when the Callback is not NULL.
EFI_NOT_STARTEDA callback function is not registered on the same attribute opcode and attribute handle, when the Callback is NULL

Variable Documentation

EFI_GUID gEfiBluetoothLeConfigProtocolGuid