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