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