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