]>
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 | |
2f88bd3a MK |
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 | |
362c355c QS |
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 | |
2f88bd3a | 36 | BLUETOOTH_ADDRESS BDAddr;\r |
362c355c | 37 | ///\r |
9095d37b | 38 | /// State of the remote deive\r |
362c355c | 39 | ///\r |
2f88bd3a | 40 | UINT8 RemoteDeviceState;\r |
362c355c QS |
41 | ///\r |
42 | /// Bluetooth ClassOfDevice. See Bluetooth specification for detail.\r | |
43 | ///\r | |
2f88bd3a | 44 | BLUETOOTH_CLASS_OF_DEVICE ClassOfDevice;\r |
362c355c QS |
45 | ///\r |
46 | /// Remote device name\r | |
47 | ///\r | |
2f88bd3a | 48 | UINT8 RemoteDeviceName[BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE];\r |
362c355c QS |
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 | 87 | EfiBluetoothConfigDataTypeRandomAddress, /* Relevant for LE*/\r |
2f88bd3a | 88 | EfiBluetoothConfigDataTypeRSSI, /* Relevant for LE*/\r |
0cbd5830 RN |
89 | ///\r |
90 | /// Advertisement report. Data structure is UNIT8[].\r | |
91 | ///\r | |
92 | EfiBluetoothConfigDataTypeAdvertisementData, /* Relevant for LE*/\r | |
2f88bd3a MK |
93 | EfiBluetoothConfigDataTypeIoCapability, /* Relevant for LE*/\r |
94 | EfiBluetoothConfigDataTypeOOBDataFlag, /* Relevant for LE*/\r | |
0cbd5830 RN |
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 | |
2f88bd3a | 100 | EfiBluetoothConfigDataTypeKeyType, /* Relevant for LE*/\r |
0cbd5830 | 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 | |
362c355c QS |
157 | /**\r |
158 | Initialize Bluetooth host controller and local device.\r | |
159 | \r | |
160 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
161 | \r | |
162 | @retval EFI_SUCCESS The Bluetooth host controller and local device is initialized successfully.\r | |
9095d37b | 163 | @retval EFI_DEVICE_ERROR A hardware error occurred trying to initialize the Bluetooth host controller\r |
362c355c QS |
164 | and local device.\r |
165 | \r | |
166 | **/\r | |
9095d37b | 167 | typedef\r |
362c355c QS |
168 | EFI_STATUS\r |
169 | (EFIAPI *EFI_BLUETOOTH_CONFIG_INIT)(\r | |
170 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This\r | |
171 | );\r | |
9095d37b | 172 | \r |
362c355c QS |
173 | /**\r |
174 | Callback function, it is called if a Bluetooth device is found during scan process.\r | |
175 | \r | |
176 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
177 | @param Context Context passed from scan request.\r | |
178 | @param CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.\r | |
179 | \r | |
180 | @retval EFI_SUCCESS The callback function complete successfully.\r | |
181 | \r | |
182 | **/\r | |
183 | typedef\r | |
184 | EFI_STATUS\r | |
2f88bd3a | 185 | (EFIAPI *EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION)(\r |
362c355c QS |
186 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r |
187 | IN VOID *Context,\r | |
188 | IN EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION *CallbackInfo\r | |
189 | );\r | |
9095d37b | 190 | \r |
362c355c QS |
191 | /**\r |
192 | Scan Bluetooth device.\r | |
193 | \r | |
194 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
9095d37b LG |
195 | @param ReScan If TRUE, a new scan request is submitted no matter there is scan result before.\r |
196 | If FALSE and there is scan result, the previous scan result is returned and no scan request\r | |
362c355c QS |
197 | is submitted.\r |
198 | @param ScanType Bluetooth scan type, Inquiry and/or Page. See Bluetooth specification for detail.\r | |
9095d37b | 199 | @param Callback The callback function. This function is called if a Bluetooth device is found during scan\r |
362c355c QS |
200 | process.\r |
201 | @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r | |
202 | \r | |
203 | @retval EFI_SUCCESS The Bluetooth scan request is submitted.\r | |
204 | @retval EFI_DEVICE_ERROR A hardware error occurred trying to scan the Bluetooth device.\r | |
205 | \r | |
206 | **/\r | |
9095d37b | 207 | typedef\r |
362c355c QS |
208 | EFI_STATUS\r |
209 | (EFIAPI *EFI_BLUETOOTH_CONFIG_SCAN)(\r | |
210 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
211 | IN BOOLEAN ReScan,\r | |
212 | IN UINT8 ScanType,\r | |
213 | IN EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION Callback,\r | |
214 | IN VOID *Context\r | |
215 | );\r | |
9095d37b | 216 | \r |
362c355c QS |
217 | /**\r |
218 | Connect a Bluetooth device.\r | |
219 | \r | |
220 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
221 | @param BD_ADDR The address of Bluetooth device to be connected.\r | |
222 | \r | |
223 | @retval EFI_SUCCESS The Bluetooth device is connected successfully.\r | |
224 | @retval EFI_ALREADY_STARTED The Bluetooth device is already connected.\r | |
225 | @retval EFI_NOT_FOUND The Bluetooth device is not found.\r | |
226 | @retval EFI_DEVICE_ERROR A hardware error occurred trying to connect the Bluetooth device.\r | |
227 | \r | |
228 | **/\r | |
9095d37b | 229 | typedef\r |
362c355c QS |
230 | EFI_STATUS\r |
231 | (EFIAPI *EFI_BLUETOOTH_CONFIG_CONNECT)(\r | |
232 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
233 | IN BLUETOOTH_ADDRESS *BD_ADDR\r | |
234 | );\r | |
235 | \r | |
236 | /**\r | |
237 | Disconnect a Bluetooth device.\r | |
238 | \r | |
239 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
240 | @param BD_ADDR The address of Bluetooth device to be connected.\r | |
241 | @param Reason Bluetooth disconnect reason. See Bluetooth specification for detail.\r | |
242 | \r | |
243 | @retval EFI_SUCCESS The Bluetooth device is disconnected successfully.\r | |
244 | @retval EFI_NOT_STARTED The Bluetooth device is not connected.\r | |
245 | @retval EFI_NOT_FOUND The Bluetooth device is not found.\r | |
246 | @retval EFI_DEVICE_ERROR A hardware error occurred trying to disconnect the Bluetooth device.\r | |
247 | \r | |
248 | **/\r | |
9095d37b | 249 | typedef\r |
362c355c QS |
250 | EFI_STATUS\r |
251 | (EFIAPI *EFI_BLUETOOTH_CONFIG_DISCONNECT)(\r | |
252 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
253 | IN BLUETOOTH_ADDRESS *BD_ADDR,\r | |
254 | IN UINT8 Reason\r | |
255 | );\r | |
9095d37b | 256 | \r |
362c355c QS |
257 | /**\r |
258 | Get Bluetooth configuration data.\r | |
259 | \r | |
260 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
261 | @param DataType Configuration data type.\r | |
262 | @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.\r | |
263 | On output, indicates the amount of data actually returned.\r | |
264 | @param Data A pointer to the buffer of data that will be returned.\r | |
265 | \r | |
266 | @retval EFI_SUCCESS The Bluetooth configuration data is returned successfully.\r | |
267 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
268 | - DataSize is NULL.\r | |
d52f8e43 | 269 | - *DataSize is not 0 and Data is NULL.\r |
362c355c QS |
270 | @retval EFI_UNSUPPORTED The DataType is unsupported.\r |
271 | @retval EFI_NOT_FOUND The DataType is not found.\r | |
272 | @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.\r | |
d52f8e43 | 273 | *DataSize has been updated with the size needed to complete the request.\r |
362c355c QS |
274 | \r |
275 | **/\r | |
9095d37b | 276 | typedef\r |
362c355c QS |
277 | EFI_STATUS\r |
278 | (EFIAPI *EFI_BLUETOOTH_CONFIG_GET_DATA)(\r | |
279 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
280 | IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,\r | |
281 | IN OUT UINTN *DataSize,\r | |
282 | IN OUT VOID *Data\r | |
283 | );\r | |
9095d37b | 284 | \r |
362c355c QS |
285 | /**\r |
286 | Set Bluetooth configuration data.\r | |
287 | \r | |
288 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
289 | @param DataType Configuration data type.\r | |
290 | @param DataSize Indicates the size, in bytes, of the data buffer specified by Data.\r | |
291 | @param Data A pointer to the buffer of data that will be set.\r | |
292 | \r | |
293 | @retval EFI_SUCCESS The Bluetooth configuration data is set successfully.\r | |
294 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
295 | - DataSize is 0.\r | |
296 | - Data is NULL.\r | |
297 | @retval EFI_UNSUPPORTED The DataType is unsupported.\r | |
298 | @retval EFI_BUFFER_TOO_SMALL Cannot set configuration data.\r | |
299 | \r | |
300 | **/\r | |
9095d37b | 301 | typedef\r |
362c355c QS |
302 | EFI_STATUS\r |
303 | (EFIAPI *EFI_BLUETOOTH_CONFIG_SET_DATA)(\r | |
304 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
305 | IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,\r | |
306 | IN UINTN DataSize,\r | |
307 | IN VOID *Data\r | |
308 | );\r | |
9095d37b | 309 | \r |
362c355c QS |
310 | /**\r |
311 | Get remove Bluetooth device configuration data.\r | |
312 | \r | |
313 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
314 | @param DataType Configuration data type.\r | |
315 | @param BDAddr Remote Bluetooth device address.\r | |
316 | @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.\r | |
317 | On output, indicates the amount of data actually returned.\r | |
318 | @param Data A pointer to the buffer of data that will be returned.\r | |
319 | \r | |
320 | @retval EFI_SUCCESS The remote Bluetooth device configuration data is returned successfully.\r | |
321 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
322 | - DataSize is NULL.\r | |
d52f8e43 | 323 | - *DataSize is not 0 and Data is NULL.\r |
362c355c QS |
324 | @retval EFI_UNSUPPORTED The DataType is unsupported.\r |
325 | @retval EFI_NOT_FOUND The DataType is not found.\r | |
326 | @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.\r | |
d52f8e43 | 327 | *DataSize has been updated with the size needed to complete the request.\r |
362c355c QS |
328 | \r |
329 | **/\r | |
9095d37b | 330 | typedef\r |
362c355c QS |
331 | EFI_STATUS\r |
332 | (EFIAPI *EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA)(\r | |
333 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
334 | IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,\r | |
0cbd5830 | 335 | IN BLUETOOTH_ADDRESS *BDAddr,\r |
362c355c QS |
336 | IN OUT UINTN *DataSize,\r |
337 | IN OUT VOID *Data\r | |
338 | );\r | |
9095d37b | 339 | \r |
362c355c QS |
340 | /**\r |
341 | The callback function for PIN code.\r | |
342 | \r | |
343 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
344 | @param Context Context passed from registration.\r | |
345 | @param CallbackType Callback type in EFI_BLUETOOTH_PIN_CALLBACK_TYPE.\r | |
346 | @param InputBuffer A pointer to the buffer of data that is input from callback caller.\r | |
347 | @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.\r | |
9095d37b | 348 | @param OutputBuffer A pointer to the buffer of data that will be output from callback callee.\r |
362c355c QS |
349 | Callee allocates this buffer by using EFI Boot Service AllocatePool().\r |
350 | @param OutputBufferSize Indicates the size, in bytes, of the data buffer specified by OutputBuffer.\r | |
351 | \r | |
352 | @retval EFI_SUCCESS The callback function complete successfully.\r | |
353 | \r | |
354 | **/\r | |
9095d37b | 355 | typedef\r |
362c355c QS |
356 | EFI_STATUS\r |
357 | (EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION)(\r | |
358 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
359 | IN VOID *Context,\r | |
360 | IN EFI_BLUETOOTH_PIN_CALLBACK_TYPE CallbackType,\r | |
361 | IN VOID *InputBuffer,\r | |
362 | IN UINTN InputBufferSize,\r | |
363 | OUT VOID **OutputBuffer,\r | |
364 | OUT UINTN *OutputBufferSize\r | |
365 | );\r | |
9095d37b | 366 | \r |
362c355c QS |
367 | /**\r |
368 | Register PIN callback function.\r | |
369 | \r | |
370 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
371 | @param Callback The callback function. NULL means unregister.\r | |
372 | @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r | |
373 | \r | |
374 | @retval EFI_SUCCESS The PIN callback function is registered successfully.\r | |
375 | \r | |
376 | **/\r | |
9095d37b | 377 | typedef\r |
362c355c QS |
378 | EFI_STATUS\r |
379 | (EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK)(\r | |
380 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
381 | IN EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION Callback,\r | |
382 | IN VOID *Context\r | |
383 | );\r | |
384 | \r | |
385 | /**\r | |
386 | The callback function to get link key.\r | |
387 | \r | |
388 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
389 | @param Context Context passed from registration.\r | |
390 | @param BDAddr A pointer to Bluetooth device address.\r | |
391 | @param LinkKey A pointer to the buffer of link key.\r | |
392 | \r | |
393 | @retval EFI_SUCCESS The callback function complete successfully.\r | |
394 | \r | |
395 | **/\r | |
9095d37b | 396 | typedef\r |
362c355c QS |
397 | EFI_STATUS\r |
398 | (EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION)(\r | |
399 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
400 | IN VOID *Context,\r | |
401 | IN BLUETOOTH_ADDRESS *BDAddr,\r | |
402 | OUT UINT8 LinkKey[BLUETOOTH_HCI_LINK_KEY_SIZE]\r | |
403 | );\r | |
9095d37b | 404 | \r |
362c355c QS |
405 | /**\r |
406 | Register get link key callback function.\r | |
407 | \r | |
408 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
409 | @param Callback The callback function. NULL means unregister.\r | |
410 | @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r | |
411 | \r | |
412 | @retval EFI_SUCCESS The link key callback function is registered successfully.\r | |
413 | \r | |
414 | **/\r | |
9095d37b | 415 | typedef\r |
362c355c QS |
416 | EFI_STATUS\r |
417 | (EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK)(\r | |
418 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
419 | IN EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION Callback,\r | |
420 | IN VOID *Context\r | |
421 | );\r | |
9095d37b | 422 | \r |
362c355c QS |
423 | /**\r |
424 | The callback function to set link key.\r | |
425 | \r | |
426 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
427 | @param Context Context passed from registration.\r | |
428 | @param BDAddr A pointer to Bluetooth device address.\r | |
429 | @param LinkKey A pointer to the buffer of link key.\r | |
430 | \r | |
431 | @retval EFI_SUCCESS The callback function complete successfully.\r | |
432 | \r | |
433 | **/\r | |
9095d37b | 434 | typedef\r |
362c355c QS |
435 | EFI_STATUS\r |
436 | (EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION)(\r | |
437 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
438 | IN VOID *Context,\r | |
439 | IN BLUETOOTH_ADDRESS *BDAddr,\r | |
440 | IN UINT8 LinkKey[BLUETOOTH_HCI_LINK_KEY_SIZE]\r | |
441 | );\r | |
9095d37b | 442 | \r |
362c355c QS |
443 | /**\r |
444 | Register set link key callback function.\r | |
445 | \r | |
446 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
447 | @param Callback The callback function. NULL means unregister.\r | |
448 | @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r | |
449 | \r | |
450 | @retval EFI_SUCCESS The link key callback function is registered successfully.\r | |
451 | \r | |
452 | **/\r | |
9095d37b | 453 | typedef\r |
362c355c QS |
454 | EFI_STATUS\r |
455 | (EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK)(\r | |
456 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
457 | IN EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION Callback,\r | |
458 | IN VOID *Context\r | |
459 | );\r | |
9095d37b | 460 | \r |
362c355c QS |
461 | /**\r |
462 | The callback function. It is called after connect completed.\r | |
463 | \r | |
464 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
465 | @param Context Context passed from registration.\r | |
466 | @param CallbackType Callback type in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.\r | |
467 | @param BDAddr A pointer to Bluetooth device address.\r | |
468 | @param InputBuffer A pointer to the buffer of data that is input from callback caller.\r | |
469 | @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.\r | |
470 | \r | |
471 | @retval EFI_SUCCESS The callback function complete successfully.\r | |
472 | \r | |
473 | **/\r | |
9095d37b | 474 | typedef\r |
362c355c QS |
475 | EFI_STATUS\r |
476 | (EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION)(\r | |
477 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
478 | IN VOID *Context,\r | |
479 | IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType,\r | |
480 | IN BLUETOOTH_ADDRESS *BDAddr,\r | |
481 | IN VOID *InputBuffer,\r | |
482 | IN UINTN InputBufferSize\r | |
483 | );\r | |
9095d37b | 484 | \r |
362c355c QS |
485 | /**\r |
486 | Register link connect complete callback function.\r | |
487 | \r | |
488 | @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.\r | |
489 | @param Callback The callback function. NULL means unregister.\r | |
490 | @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r | |
491 | \r | |
492 | @retval EFI_SUCCESS The link connect complete callback function is registered successfully.\r | |
493 | \r | |
494 | **/\r | |
9095d37b | 495 | typedef\r |
362c355c QS |
496 | EFI_STATUS\r |
497 | (EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK)(\r | |
498 | IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,\r | |
499 | IN EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION Callback,\r | |
500 | IN VOID *Context\r | |
501 | );\r | |
9095d37b | 502 | \r |
362c355c QS |
503 | ///\r |
504 | /// This protocol abstracts user interface configuration for Bluetooth device.\r | |
505 | ///\r | |
506 | struct _EFI_BLUETOOTH_CONFIG_PROTOCOL {\r | |
2f88bd3a MK |
507 | EFI_BLUETOOTH_CONFIG_INIT Init;\r |
508 | EFI_BLUETOOTH_CONFIG_SCAN Scan;\r | |
509 | EFI_BLUETOOTH_CONFIG_CONNECT Connect;\r | |
510 | EFI_BLUETOOTH_CONFIG_DISCONNECT Disconnect;\r | |
511 | EFI_BLUETOOTH_CONFIG_GET_DATA GetData;\r | |
512 | EFI_BLUETOOTH_CONFIG_SET_DATA SetData;\r | |
513 | EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA GetRemoteData;\r | |
514 | EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK RegisterPinCallback;\r | |
515 | EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK RegisterGetLinkKeyCallback;\r | |
516 | EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK RegisterSetLinkKeyCallback;\r | |
517 | EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkConnectCompleteCallback;\r | |
362c355c QS |
518 | };\r |
519 | \r | |
2f88bd3a | 520 | extern EFI_GUID gEfiBluetoothConfigProtocolGuid;\r |
362c355c QS |
521 | \r |
522 | #endif\r |