]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/BluetoothLeConfig.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / BluetoothLeConfig.h
CommitLineData
9c94cc2c
RN
1/** @file\r
2 EFI Bluetooth LE Config Protocol as defined in UEFI 2.7.\r
3 This protocol abstracts user interface configuration for BluetoothLe device.\r
4\r
5 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
9344f092 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
9c94cc2c
RN
7\r
8 @par Revision Reference:\r
9 This Protocol is introduced in UEFI Specification 2.7\r
10\r
11**/\r
12\r
13#ifndef __EFI_BLUETOOTH_LE_CONFIG_H__\r
14#define __EFI_BLUETOOTH_LE_CONFIG_H__\r
15\r
16#include <Protocol/BluetoothConfig.h>\r
17#include <Protocol/BluetoothAttribute.h>\r
18\r
19#define EFI_BLUETOOTH_LE_CONFIG_PROTOCOL_GUID \\r
20 { \\r
21 0x8f76da58, 0x1f99, 0x4275, { 0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c, 0xe8 } \\r
22 }\r
23\r
24typedef struct _EFI_BLUETOOTH_LE_CONFIG_PROTOCOL EFI_BLUETOOTH_LE_CONFIG_PROTOCOL;\r
25\r
26/**\r
27 Initialize BluetoothLE host controller and local device.\r
28\r
29 The Init() function initializes BluetoothLE host controller and local device.\r
30\r
31 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
32\r
33 @retval EFI_SUCCESS The BluetoothLE host controller and local device is initialized successfully.\r
34 @retval EFI_DEVICE_ERROR A hardware error occurred trying to initialize the BluetoothLE host controller\r
35 and local device.\r
36\r
37**/\r
38typedef\r
39EFI_STATUS\r
40(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_INIT)(\r
41 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This\r
42 );\r
43\r
44typedef struct {\r
45 ///\r
46 /// The version of the structure. A value of zero represents the EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER\r
47 /// structure as defined here. Future version of this specification may extend this data structure in a\r
48 /// backward compatible way and increase the value of Version.\r
49 ///\r
50 UINT32 Version;\r
51 ///\r
52 /// Passive scanning or active scanning. See Bluetooth specification.\r
53 ///\r
54 UINT8 ScanType;\r
55 ///\r
56 /// Recommended scan interval to be used while performing scan.\r
57 ///\r
58 UINT16 ScanInterval;\r
59 ///\r
60 /// Recommended scan window to be used while performing a scan.\r
61 ///\r
62 UINT16 ScanWindow;\r
63 ///\r
64 /// Recommended scanning filter policy to be used while performing a scan.\r
65 ///\r
66 UINT8 ScanningFilterPolicy;\r
67 ///\r
68 /// This is one byte flag to serve as a filter to remove unneeded scan\r
69 /// result. For example, set BIT0 means scan in LE Limited Discoverable\r
70 /// Mode. Set BIT1 means scan in LE General Discoverable Mode.\r
71 ///\r
72 UINT8 AdvertisementFlagFilter;\r
73} EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER;\r
74\r
75typedef struct{\r
76 BLUETOOTH_LE_ADDRESS BDAddr;\r
77 BLUETOOTH_LE_ADDRESS DirectAddress;\r
78 UINT8 RemoteDeviceState;\r
79 INT8 RSSI;\r
80 UINTN AdvertisementDataSize;\r
81 VOID *AdvertisementData;\r
82} EFI_BLUETOOTH_LE_SCAN_CALLBACK_INFORMATION;\r
83\r
84/**\r
85 Callback function, it is called if a BluetoothLE device is found during scan process.\r
86\r
87 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
88 @param[in] Context Context passed from scan request.\r
89 @param[in] CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.\r
90\r
91 @retval EFI_SUCCESS The callback function complete successfully.\r
92\r
93**/\r
94typedef\r
95EFI_STATUS\r
96(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SCAN_CALLBACK_FUNCTION) (\r
97 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
98 IN VOID *Context,\r
99 IN EFI_BLUETOOTH_LE_SCAN_CALLBACK_INFORMATION *CallbackInfo\r
100 );\r
101\r
102/**\r
103 Scan BluetoothLE device.\r
104\r
105 The Scan() function scans BluetoothLE device. When this function is returned, it just means scan\r
106 request is submitted. It does not mean scan process is started or finished. Whenever there is a\r
107 BluetoothLE device is found, the Callback function will be called. Callback function might be\r
108 called before this function returns or after this function returns\r
109\r
110 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
111 @param[in] ReScan If TRUE, a new scan request is submitted no matter there is scan result before.\r
112 If FALSE and there is scan result, the previous scan result is returned and no scan request\r
113 is submitted.\r
114 @param[in] Timeout Duration in milliseconds for which to scan.\r
115 @param[in] ScanParameter If it is not NULL, the ScanParameter is used to perform a scan by the BluetoothLE bus driver.\r
116 If it is NULL, the default parameter is used.\r
117 @param[in] Callback The callback function. This function is called if a BluetoothLE device is found during\r
118 scan process.\r
119 @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.\r
120\r
121 @retval EFI_SUCCESS The Bluetooth scan request is submitted.\r
122 @retval EFI_DEVICE_ERROR A hardware error occurred trying to scan the BluetoothLE device.\r
123\r
124**/\r
125typedef\r
126EFI_STATUS\r
127(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SCAN)(\r
128 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
129 IN BOOLEAN ReScan,\r
130 IN UINT32 Timeout,\r
131 IN EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER *ScanParameter, OPTIONAL\r
132 IN EFI_BLUETOOTH_LE_CONFIG_SCAN_CALLBACK_FUNCTION Callback,\r
133 IN VOID *Context\r
134 );\r
135\r
136typedef struct {\r
137 ///\r
138 /// The version of the structure. A value of zero represents the\r
139 /// EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER\r
140 /// structure as defined here. Future version of this specification may\r
141 /// extend this data structure in a backward compatible way and\r
142 /// increase the value of Version.\r
143 ///\r
144 UINT32 Version;\r
145 ///\r
146 /// Recommended scan interval to be used while performing scan before connect.\r
147 ///\r
148 UINT16 ScanInterval;\r
149 ///\r
150 /// Recommended scan window to be used while performing a connection\r
151 ///\r
152 UINT16 ScanWindow;\r
153 ///\r
154 /// Minimum allowed connection interval. Shall be less than or equal to ConnIntervalMax.\r
155 ///\r
156 UINT16 ConnIntervalMin;\r
157 ///\r
158 /// Maximum allowed connection interval. Shall be greater than or equal to ConnIntervalMin.\r
159 ///\r
160 UINT16 ConnIntervalMax;\r
161 ///\r
162 /// Slave latency for the connection in number of connection events.\r
163 ///\r
164 UINT16 ConnLatency;\r
165 ///\r
166 /// Link supervision timeout for the connection.\r
167 ///\r
168 UINT16 SupervisionTimeout;\r
169} EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER;\r
170\r
171/**\r
172 Connect a BluetoothLE device.\r
173\r
174 The Connect() function connects a Bluetooth device. When this function is returned successfully,\r
175 a new EFI_BLUETOOTH_IO_PROTOCOL is created.\r
176\r
177 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
178 @param[in] AutoReconnect If TRUE, the BluetoothLE host controller needs to do an auto\r
179 reconnect. If FALSE, the BluetoothLE host controller does not do\r
180 an auto reconnect.\r
181 @param[in] DoBonding If TRUE, the BluetoothLE host controller needs to do a bonding.\r
182 If FALSE, the BluetoothLE host controller does not do a bonding.\r
183 @param[in] ConnectParameter If it is not NULL, the ConnectParameter is used to perform a\r
184 scan by the BluetoothLE bus driver. If it is NULL, the default\r
185 parameter is used.\r
186 @param[in] BD_ADDR The address of the BluetoothLE device to be connected.\r
187\r
188 @retval EFI_SUCCESS The BluetoothLE device is connected successfully.\r
189 @retval EFI_ALREADY_STARTED The BluetoothLE device is already connected.\r
190 @retval EFI_NOT_FOUND The BluetoothLE device is not found.\r
191 @retval EFI_DEVICE_ERROR A hardware error occurred trying to connect the BluetoothLE device.\r
192\r
193**/\r
194typedef\r
195EFI_STATUS\r
196(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_CONNECT)(\r
197 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
198 IN BOOLEAN AutoReconnect,\r
199 IN BOOLEAN DoBonding,\r
200 IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER *ConnectParameter, OPTIONAL\r
201 IN BLUETOOTH_LE_ADDRESS *BD_ADDR\r
202 );\r
203\r
204/**\r
205 Disconnect a BluetoothLE device.\r
206\r
207 The Disconnect() function disconnects a BluetoothLE device. When this function is returned\r
208 successfully, the EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL associated with this device is\r
209 destroyed and all services associated are stopped.\r
210\r
211 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
212 @param[in] BD_ADDR The address of BluetoothLE device to be connected.\r
213 @param[in] Reason Bluetooth disconnect reason. See Bluetooth specification for detail.\r
214\r
215 @retval EFI_SUCCESS The BluetoothLE device is disconnected successfully.\r
216 @retval EFI_NOT_STARTED The BluetoothLE device is not connected.\r
217 @retval EFI_NOT_FOUND The BluetoothLE device is not found.\r
218 @retval EFI_DEVICE_ERROR A hardware error occurred trying to disconnect the BluetoothLE device.\r
219\r
220**/\r
221typedef\r
222EFI_STATUS\r
223(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_DISCONNECT)(\r
224 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
225 IN BLUETOOTH_LE_ADDRESS *BD_ADDR,\r
226 IN UINT8 Reason\r
227 );\r
228\r
229/**\r
230 Get BluetoothLE configuration data.\r
231\r
232 The GetData() function returns BluetoothLE configuration data. For remote BluetoothLE device\r
233 configuration data, please use GetRemoteData() function with valid BD_ADDR.\r
234\r
235 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
236 @param[in] DataType Configuration data type.\r
237 @param[in, out] DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.\r
238 On output, indicates the amount of data actually returned.\r
239 @param[in, out] Data A pointer to the buffer of data that will be returned.\r
240\r
241 @retval EFI_SUCCESS The BluetoothLE configuration data is returned successfully.\r
242 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
243 - DataSize is NULL.\r
244 - *DataSize is 0.\r
245 - Data is NULL.\r
246 @retval EFI_UNSUPPORTED The DataType is unsupported.\r
247 @retval EFI_NOT_FOUND The DataType is not found.\r
248 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.\r
249\r
250**/\r
251typedef\r
252EFI_STATUS\r
253(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_GET_DATA) (\r
254 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
255 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,\r
256 IN OUT UINTN *DataSize,\r
257 IN OUT VOID *Data OPTIONAL\r
258 );\r
259\r
260/**\r
261 Set BluetoothLE configuration data.\r
262\r
263 The SetData() function sets local BluetoothLE device configuration data. Not all DataType can be\r
264 set.\r
265\r
266 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
267 @param[in] DataType Configuration data type.\r
268 @param[in] DataSize Indicates the size, in bytes, of the data buffer specified by Data.\r
269 @param[in] Data A pointer to the buffer of data that will be set.\r
270\r
271 @retval EFI_SUCCESS The BluetoothLE configuration data is set successfully.\r
272 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
273 - DataSize is 0.\r
274 - Data is NULL.\r
275 @retval EFI_UNSUPPORTED The DataType is unsupported.\r
276 @retval EFI_WRITE_PROTECTED Cannot set configuration data.\r
277\r
278**/\r
279typedef\r
280EFI_STATUS\r
281(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SET_DATA) (\r
282 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
283 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,\r
284 IN UINTN DataSize,\r
285 IN VOID *Data\r
286 );\r
287\r
288/**\r
289 Get remove BluetoothLE device configuration data.\r
290\r
291 The GetRemoteData() function returns remote BluetoothLE device configuration data.\r
292\r
293 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
294 @param[in] DataType Configuration data type.\r
295 @param[in] BDAddr Remote BluetoothLE device address.\r
296 @param[in, out] DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.\r
297 On output, indicates the amount of data actually returned.\r
298 @param[in, out] Data A pointer to the buffer of data that will be returned.\r
299\r
300 @retval EFI_SUCCESS The remote BluetoothLE device configuration data is returned successfully.\r
301 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
302 - DataSize is NULL.\r
303 - *DataSize is 0.\r
304 - Data is NULL.\r
305 @retval EFI_UNSUPPORTED The DataType is unsupported.\r
306 @retval EFI_NOT_FOUND The DataType is not found.\r
307 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.\r
308\r
309**/\r
310typedef\r
311EFI_STATUS\r
312(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_GET_REMOTE_DATA) (\r
313 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
314 IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,\r
315 IN BLUETOOTH_LE_ADDRESS *BDAddr,\r
316 IN OUT UINTN *DataSize,\r
317 IN OUT VOID *Data\r
318 );\r
319\r
320typedef enum {\r
321 ///\r
322 /// It indicates an authorization request. No data is associated with the callback\r
323 /// input. In the output data, the application should return the authorization value.\r
324 /// The data structure is BOOLEAN. TRUE means YES. FALSE means NO.\r
325 ///\r
326 EfiBluetoothSmpAuthorizationRequestEvent,\r
327 ///\r
328 /// It indicates that a passkey has been generated locally by the driver, and the same\r
329 /// passkey should be entered at the remote device. The callback input data is the\r
330 /// passkey of type UINT32, to be displayed by the application. No output data\r
331 /// should be returned.\r
332 ///\r
333 EfiBluetoothSmpPasskeyReadyEvent,\r
334 ///\r
335 /// It indicates that the driver is requesting for the passkey has been generated at\r
336 /// the remote device. No data is associated with the callback input. The output data\r
337 /// is the passkey of type UINT32, to be entered by the user.\r
338 ///\r
339 EfiBluetoothSmpPasskeyRequestEvent,\r
340 ///\r
341 /// It indicates that the driver is requesting for the passkey that has been pre-shared\r
342 /// out-of-band with the remote device. No data is associated with the callback\r
343 /// input. The output data is the stored OOB data of type UINT8[16].\r
344 ///\r
345 EfiBluetoothSmpOOBDataRequestEvent,\r
346 ///\r
347 /// In indicates that a number have been generated locally by the bus driver, and\r
348 /// also at the remote device, and the bus driver wants to know if the two numbers\r
349 /// match. The callback input data is the number of type UINT32. The output data\r
350 /// is confirmation value of type BOOLEAN. TRUE means comparison pass. FALSE\r
351 /// means comparison fail.\r
352 ///\r
353 EfiBluetoothSmpNumericComparisonEvent,\r
354} EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE;\r
355\r
356/**\r
357 The callback function for SMP.\r
358\r
359 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
360 @param[in] Context Data passed into callback function. This is optional parameter\r
361 and may be NULL.\r
362 @param[in] BDAddr Remote BluetoothLE device address.\r
363 @param[in] EventDataType Event data type in EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE.\r
364 @param[in] DataSize Indicates the size, in bytes, of the data buffer specified by Data.\r
365 @param[in] Data A pointer to the buffer of data.\r
366\r
367 @retval EFI_SUCCESS The callback function complete successfully.\r
368\r
369**/\r
370typedef\r
371EFI_STATUS\r
372(EFIAPI *EFI_BLUETOOTH_LE_SMP_CALLBACK) (\r
373 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
374 IN VOID *Context,\r
375 IN BLUETOOTH_LE_ADDRESS *BDAddr,\r
376 IN EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE EventDataType,\r
377 IN UINTN DataSize,\r
378 IN VOID *Data\r
379 );\r
380\r
381/**\r
382 Register Security Manager Protocol callback function for user authentication/authorization.\r
383\r
384 The RegisterSmpAuthCallback() function register Security Manager Protocol callback\r
385 function for user authentication/authorization.\r
386\r
387 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
388 @param[in] Callback Callback function for user authentication/authorization.\r
389 @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.\r
390\r
391 @retval EFI_SUCCESS The SMP callback function is registered successfully.\r
392 @retval EFI_ALREADY_STARTED A callback function is already registered on the same attribute\r
393 opcode and attribute handle, when the Callback is not NULL.\r
394 @retval EFI_NOT_STARTED A callback function is not registered on the same attribute opcode\r
395 and attribute handle, when the Callback is NULL.\r
396\r
397**/\r
398typedef\r
399EFI_STATUS\r
400(EFIAPI *EFI_BLUETOOTH_LE_REGISTER_SMP_AUTH_CALLBACK) (\r
401 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
402 IN EFI_BLUETOOTH_LE_SMP_CALLBACK Callback,\r
403 IN VOID *Context\r
404 );\r
405\r
406/**\r
407 Send user authentication/authorization to remote device.\r
408\r
409 The SendSmpAuthData() function sends user authentication/authorization to remote device. It\r
410 should be used to send these information after the caller gets the request data from the callback\r
411 function by RegisterSmpAuthCallback().\r
412\r
413 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
414 @param[in] BDAddr Remote BluetoothLE device address.\r
415 @param[in] EventDataType Event data type in EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE.\r
416 @param[in] DataSize The size of Data in bytes, of the data buffer specified by Data.\r
417 @param[in] Data A pointer to the buffer of data that will be sent. The data format\r
418 depends on the type of SMP event data being responded to.\r
419\r
420 @retval EFI_SUCCESS The SMP authorization data is sent successfully.\r
421 @retval EFI_NOT_READY SMP is not in the correct state to receive the auth data.\r
422\r
423**/\r
424typedef\r
425EFI_STATUS\r
426(EFIAPI *EFI_BLUETOOTH_LE_SEND_SMP_AUTH_DATA) (\r
427 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
428 IN BLUETOOTH_LE_ADDRESS *BDAddr,\r
429 IN EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE EventDataType,\r
430 IN UINTN DataSize,\r
431 IN VOID *Data\r
432 );\r
433\r
434typedef enum {\r
435 // For local device only\r
436 EfiBluetoothSmpLocalIR, /* If Key hierarchy is supported */\r
437 EfiBluetoothSmpLocalER, /* If Key hierarchy is supported */\r
438 EfiBluetoothSmpLocalDHK, /* If Key hierarchy is supported. OPTIONAL */\r
439 // For peer specific\r
440 EfiBluetoothSmpKeysDistributed = 0x1000,\r
441 EfiBluetoothSmpKeySize,\r
442 EfiBluetoothSmpKeyType,\r
443 EfiBluetoothSmpPeerLTK,\r
444 EfiBluetoothSmpPeerIRK,\r
445 EfiBluetoothSmpPeerCSRK,\r
446 EfiBluetoothSmpPeerRand,\r
447 EfiBluetoothSmpPeerEDIV,\r
448 EfiBluetoothSmpPeerSignCounter,\r
449 EfiBluetoothSmpLocalLTK, /* If Key hierarchy not supported */\r
450 EfiBluetoothSmpLocalIRK, /* If Key hierarchy not supported */\r
451 EfiBluetoothSmpLocalCSRK, /* If Key hierarchy not supported */\r
452 EfiBluetoothSmpLocalSignCounter,\r
453 EfiBluetoothSmpLocalDIV,\r
454} EFI_BLUETOOTH_LE_SMP_DATA_TYPE;\r
455\r
456/**\r
457 The callback function to get SMP data.\r
458\r
459 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
460 @param[in] Context Data passed into callback function. This is optional parameter\r
461 and may be NULL.\r
462 @param[in] BDAddr Remote BluetoothLE device address. For Local device setting, it\r
463 should be NULL.\r
464 @param[in] DataType Data type in EFI_BLUETOOTH_LE_SMP_DATA_TYPE.\r
465 @param[in, out] DataSize On input, indicates the size, in bytes, of the data buffer specified\r
466 by Data. On output, indicates the amount of data actually returned.\r
467 @param[out] Data A pointer to the buffer of data that will be returned.\r
468\r
469 @retval EFI_SUCCESS The callback function complete successfully.\r
470\r
471**/\r
472typedef\r
473EFI_STATUS\r
474(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_SMP_GET_DATA_CALLBACK) (\r
475 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
476 IN VOID *Context,\r
477 IN BLUETOOTH_LE_ADDRESS *BDAddr,\r
478 IN EFI_BLUETOOTH_LE_SMP_DATA_TYPE DataType,\r
479 IN OUT UINTN *DataSize,\r
480 OUT VOID *Data\r
481 );\r
482\r
483/**\r
484 Register a callback function to get SMP related data.\r
485\r
486 The RegisterSmpGetDataCallback() function registers a callback function to get SMP related data.\r
487\r
488 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
489 @param[in] Callback Callback function for SMP get data.\r
490 @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.\r
491\r
492 @retval EFI_SUCCESS The SMP get data callback function is registered successfully.\r
493 @retval EFI_ALREADY_STARTED A callback function is already registered on the same attribute\r
494 opcode and attribute handle, when the Callback is not NULL.\r
495 @retval EFI_NOT_STARTED A callback function is not registered on the same attribute opcode\r
496 and attribute handle, when the Callback is NULL\r
497**/\r
498typedef\r
499EFI_STATUS\r
500(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_GET_DATA_CALLBACK) (\r
501 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
502 IN EFI_BLUETOOTH_LE_CONFIG_SMP_GET_DATA_CALLBACK Callback,\r
503 IN VOID *Context\r
504 );\r
505\r
506/**\r
507 The callback function to set SMP data.\r
508\r
509 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
510 @param[in] Context Data passed into callback function. This is optional parameter\r
511 and may be NULL.\r
512 @param[in] BDAddr Remote BluetoothLE device address.\r
513 @param[in] DataType Data type in EFI_BLUETOOTH_LE_SMP_DATA_TYPE.\r
514 @param[in] DataSize Indicates the size, in bytes, of the data buffer specified by Data.\r
515 @param[in] Data A pointer to the buffer of data.\r
516\r
517 @retval EFI_SUCCESS The callback function complete successfully.\r
518\r
519**/\r
520typedef\r
521EFI_STATUS\r
522(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_SMP_SET_DATA_CALLBACK) (\r
523 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
524 IN VOID *Context,\r
525 IN BLUETOOTH_LE_ADDRESS *BDAddr,\r
526 IN EFI_BLUETOOTH_LE_SMP_DATA_TYPE Type,\r
527 IN UINTN DataSize,\r
528 IN VOID *Data\r
529 );\r
530\r
531/**\r
532 Register a callback function to set SMP related data.\r
533\r
534 The RegisterSmpSetDataCallback() function registers a callback function to set SMP related data.\r
535\r
536 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
537 @param[in] Callback Callback function for SMP set data.\r
538 @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.\r
539\r
540 @retval EFI_SUCCESS The SMP set data callback function is registered successfully.\r
541 @retval EFI_ALREADY_STARTED A callback function is already registered on the same attribute\r
542 opcode and attribute handle, when the Callback is not NULL.\r
543 @retval EFI_NOT_STARTED A callback function is not registered on the same attribute opcode\r
544 and attribute handle, when the Callback is NULL\r
545**/\r
546typedef\r
547EFI_STATUS\r
548(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_SET_DATA_CALLBACK) (\r
549 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
550 IN EFI_BLUETOOTH_LE_CONFIG_SMP_SET_DATA_CALLBACK Callback,\r
551 IN VOID *Context\r
552 );\r
553\r
554/**\r
555 The callback function to hook connect complete event.\r
556\r
557 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
558 @param[in] Context Data passed into callback function. This is optional parameter\r
559 and may be NULL.\r
560 @param[in] CallbackType The value defined in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.\r
561 @param[in] BDAddr Remote BluetoothLE device address.\r
562 @param[in] InputBuffer A pointer to the buffer of data that is input from callback caller.\r
563 @param[in] InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.\r
564\r
565 @retval EFI_SUCCESS The callback function complete successfully.\r
566\r
567**/\r
568typedef\r
569EFI_STATUS\r
570(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_CONNECT_COMPLETE_CALLBACK) (\r
571 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
572 IN VOID *Context,\r
573 IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType,\r
574 IN BLUETOOTH_LE_ADDRESS *BDAddr,\r
575 IN VOID *InputBuffer,\r
576 IN UINTN InputBufferSize\r
577 );\r
578\r
579/**\r
580 Register link connect complete callback function.\r
581\r
582 The RegisterLinkConnectCompleteCallback() function registers Bluetooth link connect\r
583 complete callback function. The Bluetooth Configuration driver may call\r
584 RegisterLinkConnectCompleteCallback() to register a callback function. During pairing,\r
585 Bluetooth bus driver must trigger this callback function to report device state, if it is registered.\r
586 Then Bluetooth Configuration driver will get information on device connection, according to\r
587 CallbackType defined by EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE\r
588\r
589 @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCOL instance.\r
590 @param[in] Callback The callback function. NULL means unregister.\r
591 @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.\r
592\r
593 @retval EFI_SUCCESS The link connect complete callback function is registered successfully.\r
594 @retval EFI_ALREADY_STARTED A callback function is already registered on the same attribute\r
595 opcode and attribute handle, when the Callback is not NULL.\r
596 @retval EFI_NOT_STARTED A callback function is not registered on the same attribute opcode\r
597 and attribute handle, when the Callback is NULL\r
598**/\r
599typedef\r
600EFI_STATUS\r
601(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK) (\r
602 IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This,\r
603 IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_COMPLETE_CALLBACK Callback,\r
604 IN VOID *Context\r
605 );\r
606\r
607///\r
608/// This protocol abstracts user interface configuration for BluetoothLe device.\r
609///\r
610struct _EFI_BLUETOOTH_LE_CONFIG_PROTOCOL {\r
611 EFI_BLUETOOTH_LE_CONFIG_INIT Init;\r
612 EFI_BLUETOOTH_LE_CONFIG_SCAN Scan;\r
613 EFI_BLUETOOTH_LE_CONFIG_CONNECT Connect;\r
614 EFI_BLUETOOTH_LE_CONFIG_DISCONNECT Disconnect;\r
615 EFI_BLUETOOTH_LE_CONFIG_GET_DATA GetData;\r
616 EFI_BLUETOOTH_LE_CONFIG_SET_DATA SetData;\r
617 EFI_BLUETOOTH_LE_CONFIG_GET_REMOTE_DATA GetRemoteData;\r
618 EFI_BLUETOOTH_LE_REGISTER_SMP_AUTH_CALLBACK RegisterSmpAuthCallback;\r
619 EFI_BLUETOOTH_LE_SEND_SMP_AUTH_DATA SendSmpAuthData;\r
620 EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_GET_DATA_CALLBACK RegisterSmpGetDataCallback;\r
621 EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_SET_DATA_CALLBACK RegisterSmpSetDataCallback;\r
622 EFI_BLUETOOTH_LE_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkConnectCompleteCallback;\r
623};\r
624\r
625extern EFI_GUID gEfiBluetoothLeConfigProtocolGuid;\r
626\r
627#endif\r
628\r