]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/BluetoothConfig.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / Protocol / BluetoothConfig.h
CommitLineData
362c355c 1/** @file\r
d52f8e43 2 EFI Bluetooth Configuration Protocol as defined in UEFI 2.7.\r
362c355c
QS
3 This protocol abstracts user interface configuration for Bluetooth device.\r
4\r
9095d37b
LG
5 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
6 This program and the accompanying materials are licensed and made available under\r
7 the terms and conditions of the BSD License that accompanies this distribution.\r
362c355c 8 The full text of the license may be found at\r
9095d37b
LG
9 http://opensource.org/licenses/bsd-license.php.\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
362c355c
QS
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
9095d37b 14 @par Revision Reference:\r
d52f8e43 15 This Protocol is introduced in UEFI Specification 2.7\r
362c355c
QS
16\r
17**/\r
18\r
19#ifndef __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__\r
20#define __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__\r
21\r
22#include <IndustryStandard/Bluetooth.h>\r
23\r
24#define EFI_BLUETOOTH_CONFIG_PROTOCOL_GUID \\r
25 { \\r
26 0x62960cf3, 0x40ff, 0x4263, { 0xa7, 0x7c, 0xdf, 0xde, 0xbd, 0x19, 0x1b, 0x4b } \\r
27 }\r
9095d37b 28\r
362c355c
QS
29typedef struct _EFI_BLUETOOTH_CONFIG_PROTOCOL EFI_BLUETOOTH_CONFIG_PROTOCOL;\r
30\r
31typedef UINT32 EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE;\r
32#define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_CONNECTED 0x1\r
33#define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_PAIRED 0x2\r
34\r
35///\r
36/// EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION\r
37///\r
38typedef struct {\r
39 ///\r
40 /// 48bit Bluetooth device address.\r
41 ///\r
42 BLUETOOTH_ADDRESS BDAddr;\r
43 ///\r
9095d37b 44 /// State of the remote deive\r
362c355c
QS
45 ///\r
46 UINT8 RemoteDeviceState;\r
47 ///\r
48 /// Bluetooth ClassOfDevice. See Bluetooth specification for detail.\r
49 ///\r
50 BLUETOOTH_CLASS_OF_DEVICE ClassOfDevice;\r
51 ///\r
52 /// Remote device name\r
53 ///\r
54 UINT8 RemoteDeviceName[BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE];\r
55} EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION;\r
56\r
57///\r
58/// EFI_BLUETOOTH_CONFIG_DATA_TYPE\r
59///\r
60typedef enum {\r
61 ///\r
62 /// Local/Remote Bluetooth device name. Data structure is zero terminated CHAR8[].\r
63 ///\r
64 EfiBluetoothConfigDataTypeDeviceName,\r
65 ///\r
66 /// Local/Remote Bluetooth device ClassOfDevice. Data structure is BLUETOOTH_CLASS_OF_DEVICE.\r
67 ///\r
68 EfiBluetoothConfigDataTypeClassOfDevice,\r
69 ///\r
70 /// Remote Bluetooth device state. Data structure is EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE.\r
71 ///\r
0cbd5830 72 EfiBluetoothConfigDataTypeRemoteDeviceState, /* Relevant for LE*/\r
362c355c
QS
73 ///\r
74 /// Local/Remote Bluetooth device SDP information. Data structure is UINT8[].\r
75 ///\r
76 EfiBluetoothConfigDataTypeSdpInfo,\r
77 ///\r
78 /// Local Bluetooth device address. Data structure is BLUETOOTH_ADDRESS.\r
79 ///\r
0cbd5830 80 EfiBluetoothConfigDataTypeBDADDR, /* Relevant for LE*/\r
362c355c
QS
81 ///\r
82 /// Local Bluetooth discoverable state. Data structure is UINT8. (Page scan and/or Inquiry scan)\r
83 ///\r
0cbd5830 84 EfiBluetoothConfigDataTypeDiscoverable, /* Relevant for LE*/\r
362c355c
QS
85 ///\r
86 /// Local Bluetooth controller stored paired device list. Data structure is BLUETOOTH_ADDRESS[].\r
87 ///\r
88 EfiBluetoothConfigDataTypeControllerStoredPairedDeviceList,\r
89 ///\r
90 /// Local available device list. Data structure is BLUETOOTH_ADDRESS[].\r
91 ///\r
92 EfiBluetoothConfigDataTypeAvailableDeviceList,\r
0cbd5830
RN
93 EfiBluetoothConfigDataTypeRandomAddress, /* Relevant for LE*/\r
94 EfiBluetoothConfigDataTypeRSSI, /* Relevant for LE*/\r
95 ///\r
96 /// Advertisement report. Data structure is UNIT8[].\r
97 ///\r
98 EfiBluetoothConfigDataTypeAdvertisementData, /* Relevant for LE*/\r
99 EfiBluetoothConfigDataTypeIoCapability, /* Relevant for LE*/\r
100 EfiBluetoothConfigDataTypeOOBDataFlag, /* Relevant for LE*/\r
101 ///\r
102 /// KeyType of Authentication Requirements flag of local\r
103 /// device as UINT8, indicating requested security properties.\r
104 /// See Bluetooth specification 3.H.3.5.1. BIT0: MITM, BIT1:SC.\r
105 ///\r
106 EfiBluetoothConfigDataTypeKeyType, /* Relevant for LE*/\r
107 EfiBluetoothConfigDataTypeEncKeySize, /* Relevant for LE*/\r
362c355c
QS
108 EfiBluetoothConfigDataTypeMax,\r
109} EFI_BLUETOOTH_CONFIG_DATA_TYPE;\r
110\r
111///\r
112/// EFI_BLUETOOTH_PIN_CALLBACK_TYPE.\r
113///\r
114typedef enum {\r
115 ///\r
9095d37b 116 /// For SSP - passkey entry. Input buffer is Passkey (4 bytes). No output buffer.\r
362c355c
QS
117 /// See Bluetooth HCI command for detail.\r
118 ///\r
119 EfiBluetoothCallbackTypeUserPasskeyNotification,\r
120 ///\r
9095d37b 121 /// For SSP - just work and numeric comparison. Input buffer is numeric value (4 bytes).\r
362c355c
QS
122 /// Output buffer is BOOLEAN (1 byte). See Bluetooth HCI command for detail.\r
123 ///\r
124 EfiBluetoothCallbackTypeUserConfirmationRequest,\r
125 ///\r
126 /// For SSP - OOB. See Bluetooth HCI command for detail.\r
127 ///\r
128 EfiBluetoothCallbackTypeOOBDataRequest,\r
129 ///\r
9095d37b 130 /// For legacy paring. No input buffer. Output buffer is PIN code( <= 16 bytes).\r
362c355c
QS
131 /// See Bluetooth HCI command for detail.\r
132 ///\r
133 EfiBluetoothCallbackTypePinCodeRequest,\r
134 EfiBluetoothCallbackTypeMax\r
135} EFI_BLUETOOTH_PIN_CALLBACK_TYPE;\r
136\r
137///\r
138/// EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.\r
139///\r
140typedef enum {\r
141 ///\r
9095d37b 142 /// This callback is called when Bluetooth receive Disconnection_Complete event. Input buffer is Event\r
362c355c
QS
143 /// Parameters of Disconnection_Complete Event defined in Bluetooth specification.\r
144 ///\r
145 EfiBluetoothConnCallbackTypeDisconnected,\r
146 ///\r
9095d37b 147 /// This callback is called when Bluetooth receive Connection_Complete event. Input buffer is Event\r
362c355c
QS
148 /// Parameters of Connection_Complete Event defined in Bluetooth specification.\r
149 ///\r
150 EfiBluetoothConnCallbackTypeConnected,\r
151 ///\r
9095d37b 152 /// This callback is called when Bluetooth receive Authentication_Complete event. Input buffer is Event\r
362c355c
QS
153 /// Parameters of Authentication_Complete Event defined in Bluetooth specification.\r
154 ///\r
155 EfiBluetoothConnCallbackTypeAuthenticated,\r
156 ///\r
9095d37b 157 /// This callback is called when Bluetooth receive Encryption_Change event. Input buffer is Event\r
362c355c
QS
158 /// Parameters of Encryption_Change Event defined in Bluetooth specification.\r
159 ///\r
160 EfiBluetoothConnCallbackTypeEncrypted\r
161} EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE;\r
162\r
9095d37b 163\r
362c355c
QS
164/**\r
165 Initialize Bluetooth host controller and local device.\r
166\r
167 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
168\r
169 @retval EFI_SUCCESS The Bluetooth host controller and local device is initialized successfully.\r
9095d37b 170 @retval EFI_DEVICE_ERROR A hardware error occurred trying to initialize the Bluetooth host controller\r
362c355c
QS
171 and local device.\r
172\r
173**/\r
9095d37b 174typedef\r
362c355c
QS
175EFI_STATUS\r
176(EFIAPI *EFI_BLUETOOTH_CONFIG_INIT)(\r
177 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This\r
178 );\r
9095d37b 179\r
362c355c
QS
180/**\r
181 Callback function, it is called if a Bluetooth device is found during scan process.\r
182\r
183 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
184 @param Context Context passed from scan request.\r
185 @param CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.\r
186\r
187 @retval EFI_SUCCESS The callback function complete successfully.\r
188\r
189**/\r
190typedef\r
191EFI_STATUS\r
192(EFIAPI *EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION) (\r
193 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
194 IN VOID *Context,\r
195 IN EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION *CallbackInfo\r
196 );\r
9095d37b 197\r
362c355c
QS
198/**\r
199 Scan Bluetooth device.\r
200\r
201 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
9095d37b
LG
202 @param ReScan If TRUE, a new scan request is submitted no matter there is scan result before.\r
203 If FALSE and there is scan result, the previous scan result is returned and no scan request\r
362c355c
QS
204 is submitted.\r
205 @param ScanType Bluetooth scan type, Inquiry and/or Page. See Bluetooth specification for detail.\r
9095d37b 206 @param Callback The callback function. This function is called if a Bluetooth device is found during scan\r
362c355c
QS
207 process.\r
208 @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r
209\r
210 @retval EFI_SUCCESS The Bluetooth scan request is submitted.\r
211 @retval EFI_DEVICE_ERROR A hardware error occurred trying to scan the Bluetooth device.\r
212\r
213**/\r
9095d37b 214typedef\r
362c355c
QS
215EFI_STATUS\r
216(EFIAPI *EFI_BLUETOOTH_CONFIG_SCAN)(\r
217 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
218 IN BOOLEAN ReScan,\r
219 IN UINT8 ScanType,\r
220 IN EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION Callback,\r
221 IN VOID *Context\r
222 );\r
9095d37b 223\r
362c355c
QS
224/**\r
225 Connect a Bluetooth device.\r
226\r
227 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
228 @param BD_ADDR The address of Bluetooth device to be connected.\r
229\r
230 @retval EFI_SUCCESS The Bluetooth device is connected successfully.\r
231 @retval EFI_ALREADY_STARTED The Bluetooth device is already connected.\r
232 @retval EFI_NOT_FOUND The Bluetooth device is not found.\r
233 @retval EFI_DEVICE_ERROR A hardware error occurred trying to connect the Bluetooth device.\r
234\r
235**/\r
9095d37b 236typedef\r
362c355c
QS
237EFI_STATUS\r
238(EFIAPI *EFI_BLUETOOTH_CONFIG_CONNECT)(\r
239 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
240 IN BLUETOOTH_ADDRESS *BD_ADDR\r
241 );\r
242\r
243/**\r
244 Disconnect a Bluetooth device.\r
245\r
246 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
247 @param BD_ADDR The address of Bluetooth device to be connected.\r
248 @param Reason Bluetooth disconnect reason. See Bluetooth specification for detail.\r
249\r
250 @retval EFI_SUCCESS The Bluetooth device is disconnected successfully.\r
251 @retval EFI_NOT_STARTED The Bluetooth device is not connected.\r
252 @retval EFI_NOT_FOUND The Bluetooth device is not found.\r
253 @retval EFI_DEVICE_ERROR A hardware error occurred trying to disconnect the Bluetooth device.\r
254\r
255**/\r
9095d37b 256typedef\r
362c355c
QS
257EFI_STATUS\r
258(EFIAPI *EFI_BLUETOOTH_CONFIG_DISCONNECT)(\r
259 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
260 IN BLUETOOTH_ADDRESS *BD_ADDR,\r
261 IN UINT8 Reason\r
262 );\r
9095d37b 263\r
362c355c
QS
264/**\r
265 Get Bluetooth configuration data.\r
266\r
267 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
268 @param DataType Configuration data type.\r
269 @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.\r
270 On output, indicates the amount of data actually returned.\r
271 @param Data A pointer to the buffer of data that will be returned.\r
272\r
273 @retval EFI_SUCCESS The Bluetooth configuration data is returned successfully.\r
274 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
275 - DataSize is NULL.\r
d52f8e43 276 - *DataSize is not 0 and Data is NULL.\r
362c355c
QS
277 @retval EFI_UNSUPPORTED The DataType is unsupported.\r
278 @retval EFI_NOT_FOUND The DataType is not found.\r
279 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.\r
d52f8e43 280 *DataSize has been updated with the size needed to complete the request.\r
362c355c
QS
281\r
282**/\r
9095d37b 283typedef\r
362c355c
QS
284EFI_STATUS\r
285(EFIAPI *EFI_BLUETOOTH_CONFIG_GET_DATA)(\r
286 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
287 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,\r
288 IN OUT UINTN *DataSize,\r
289 IN OUT VOID *Data\r
290 );\r
9095d37b 291\r
362c355c
QS
292/**\r
293 Set Bluetooth configuration data.\r
294\r
295 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
296 @param DataType Configuration data type.\r
297 @param DataSize Indicates the size, in bytes, of the data buffer specified by Data.\r
298 @param Data A pointer to the buffer of data that will be set.\r
299\r
300 @retval EFI_SUCCESS The Bluetooth configuration data is set successfully.\r
301 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
302 - DataSize is 0.\r
303 - Data is NULL.\r
304 @retval EFI_UNSUPPORTED The DataType is unsupported.\r
305 @retval EFI_BUFFER_TOO_SMALL Cannot set configuration data.\r
306\r
307**/\r
9095d37b 308typedef\r
362c355c
QS
309EFI_STATUS\r
310(EFIAPI *EFI_BLUETOOTH_CONFIG_SET_DATA)(\r
311 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
312 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,\r
313 IN UINTN DataSize,\r
314 IN VOID *Data\r
315 );\r
9095d37b 316\r
362c355c
QS
317/**\r
318 Get remove Bluetooth device configuration data.\r
319\r
320 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
321 @param DataType Configuration data type.\r
322 @param BDAddr Remote Bluetooth device address.\r
323 @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.\r
324 On output, indicates the amount of data actually returned.\r
325 @param Data A pointer to the buffer of data that will be returned.\r
326\r
327 @retval EFI_SUCCESS The remote Bluetooth device configuration data is returned successfully.\r
328 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
329 - DataSize is NULL.\r
d52f8e43 330 - *DataSize is not 0 and Data is NULL.\r
362c355c
QS
331 @retval EFI_UNSUPPORTED The DataType is unsupported.\r
332 @retval EFI_NOT_FOUND The DataType is not found.\r
333 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.\r
d52f8e43 334 *DataSize has been updated with the size needed to complete the request.\r
362c355c
QS
335\r
336**/\r
9095d37b 337typedef\r
362c355c
QS
338EFI_STATUS\r
339(EFIAPI *EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA)(\r
340 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
341 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,\r
0cbd5830 342 IN BLUETOOTH_ADDRESS *BDAddr,\r
362c355c
QS
343 IN OUT UINTN *DataSize,\r
344 IN OUT VOID *Data\r
345 );\r
9095d37b 346\r
362c355c
QS
347/**\r
348 The callback function for PIN code.\r
349\r
350 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
351 @param Context Context passed from registration.\r
352 @param CallbackType Callback type in EFI_BLUETOOTH_PIN_CALLBACK_TYPE.\r
353 @param InputBuffer A pointer to the buffer of data that is input from callback caller.\r
354 @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.\r
9095d37b 355 @param OutputBuffer A pointer to the buffer of data that will be output from callback callee.\r
362c355c
QS
356 Callee allocates this buffer by using EFI Boot Service AllocatePool().\r
357 @param OutputBufferSize Indicates the size, in bytes, of the data buffer specified by OutputBuffer.\r
358\r
359 @retval EFI_SUCCESS The callback function complete successfully.\r
360\r
361**/\r
9095d37b 362typedef\r
362c355c
QS
363EFI_STATUS\r
364(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION)(\r
365 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
366 IN VOID *Context,\r
367 IN EFI_BLUETOOTH_PIN_CALLBACK_TYPE CallbackType,\r
368 IN VOID *InputBuffer,\r
369 IN UINTN InputBufferSize,\r
370 OUT VOID **OutputBuffer,\r
371 OUT UINTN *OutputBufferSize\r
372 );\r
9095d37b 373\r
362c355c
QS
374/**\r
375 Register PIN callback function.\r
376\r
377 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
378 @param Callback The callback function. NULL means unregister.\r
379 @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r
380\r
381 @retval EFI_SUCCESS The PIN callback function is registered successfully.\r
382\r
383**/\r
9095d37b 384typedef\r
362c355c
QS
385EFI_STATUS\r
386(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK)(\r
387 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
388 IN EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION Callback,\r
389 IN VOID *Context\r
390 );\r
391\r
392/**\r
393 The callback function to get link key.\r
394\r
395 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
396 @param Context Context passed from registration.\r
397 @param BDAddr A pointer to Bluetooth device address.\r
398 @param LinkKey A pointer to the buffer of link key.\r
399\r
400 @retval EFI_SUCCESS The callback function complete successfully.\r
401\r
402**/\r
9095d37b 403typedef\r
362c355c
QS
404EFI_STATUS\r
405(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION)(\r
406 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
407 IN VOID *Context,\r
408 IN BLUETOOTH_ADDRESS *BDAddr,\r
409 OUT UINT8 LinkKey[BLUETOOTH_HCI_LINK_KEY_SIZE]\r
410 );\r
9095d37b 411\r
362c355c
QS
412/**\r
413 Register get link key callback function.\r
414\r
415 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
416 @param Callback The callback function. NULL means unregister.\r
417 @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r
418\r
419 @retval EFI_SUCCESS The link key callback function is registered successfully.\r
420\r
421**/\r
9095d37b 422typedef\r
362c355c
QS
423EFI_STATUS\r
424(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK)(\r
425 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
426 IN EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION Callback,\r
427 IN VOID *Context\r
428 );\r
9095d37b 429\r
362c355c
QS
430/**\r
431 The callback function to set link key.\r
432\r
433 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
434 @param Context Context passed from registration.\r
435 @param BDAddr A pointer to Bluetooth device address.\r
436 @param LinkKey A pointer to the buffer of link key.\r
437\r
438 @retval EFI_SUCCESS The callback function complete successfully.\r
439\r
440**/\r
9095d37b 441typedef\r
362c355c
QS
442EFI_STATUS\r
443(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION)(\r
444 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
445 IN VOID *Context,\r
446 IN BLUETOOTH_ADDRESS *BDAddr,\r
447 IN UINT8 LinkKey[BLUETOOTH_HCI_LINK_KEY_SIZE]\r
448 );\r
9095d37b 449\r
362c355c
QS
450/**\r
451 Register set link key callback function.\r
452\r
453 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
454 @param Callback The callback function. NULL means unregister.\r
455 @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r
456\r
457 @retval EFI_SUCCESS The link key callback function is registered successfully.\r
458\r
459**/\r
9095d37b 460typedef\r
362c355c
QS
461EFI_STATUS\r
462(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK)(\r
463 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
464 IN EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION Callback,\r
465 IN VOID *Context\r
466 );\r
9095d37b 467\r
362c355c
QS
468/**\r
469 The callback function. It is called after connect completed.\r
470\r
471 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
472 @param Context Context passed from registration.\r
473 @param CallbackType Callback type in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.\r
474 @param BDAddr A pointer to Bluetooth device address.\r
475 @param InputBuffer A pointer to the buffer of data that is input from callback caller.\r
476 @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.\r
477\r
478 @retval EFI_SUCCESS The callback function complete successfully.\r
479\r
480**/\r
9095d37b 481typedef\r
362c355c
QS
482EFI_STATUS\r
483(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION)(\r
484 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
485 IN VOID *Context,\r
486 IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType,\r
487 IN BLUETOOTH_ADDRESS *BDAddr,\r
488 IN VOID *InputBuffer,\r
489 IN UINTN InputBufferSize\r
490 );\r
9095d37b 491\r
362c355c
QS
492/**\r
493 Register link connect complete callback function.\r
494\r
495 @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r
496 @param Callback The callback function. NULL means unregister.\r
497 @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r
498\r
499 @retval EFI_SUCCESS The link connect complete callback function is registered successfully.\r
500\r
501**/\r
9095d37b 502typedef\r
362c355c
QS
503EFI_STATUS\r
504(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK)(\r
505 IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r
506 IN EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION Callback,\r
507 IN VOID *Context\r
508 );\r
9095d37b 509\r
362c355c
QS
510///\r
511/// This protocol abstracts user interface configuration for Bluetooth device.\r
512///\r
513struct _EFI_BLUETOOTH_CONFIG_PROTOCOL {\r
514 EFI_BLUETOOTH_CONFIG_INIT Init;\r
515 EFI_BLUETOOTH_CONFIG_SCAN Scan;\r
516 EFI_BLUETOOTH_CONFIG_CONNECT Connect;\r
517 EFI_BLUETOOTH_CONFIG_DISCONNECT Disconnect;\r
518 EFI_BLUETOOTH_CONFIG_GET_DATA GetData;\r
519 EFI_BLUETOOTH_CONFIG_SET_DATA SetData;\r
520 EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA GetRemoteData;\r
521 EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK RegisterPinCallback;\r
522 EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK RegisterGetLinkKeyCallback;\r
523 EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK RegisterSetLinkKeyCallback;\r
524 EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkConnectCompleteCallback;\r
525};\r
526\r
527extern EFI_GUID gEfiBluetoothConfigProtocolGuid;\r
528\r
529#endif\r