2 EFI Bluetooth IO Service Binding Protocol as defined in UEFI 2.5.
3 EFI Bluetooth IO Protocol as defined in UEFI 2.5.
4 The EFI Bluetooth IO Service Binding Protocol is used to locate EFI Bluetooth IO Protocol drivers to
5 create and destroy child of the driver to communicate with other Bluetooth device by using Bluetooth IO protocol.
7 Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials are licensed and made available under
9 the terms and conditions of the BSD License that accompanies this distribution.
10 The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php.
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 @par Revision Reference:
17 This Protocol is introduced in UEFI Specification 2.5
21 #ifndef __EFI_BLUETOOTH_IO_PROTOCOL_H__
22 #define __EFI_BLUETOOTH_IO_PROTOCOL_H__
24 #include <IndustryStandard/Bluetooth.h>
26 #define EFI_BLUETOOTH_IO_SERVICE_BINDING_PROTOCOL_GUID \
28 0x388278d3, 0x7b85, 0x42f0, { 0xab, 0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5, 0xab } \
31 #define EFI_BLUETOOTH_IO_PROTOCOL_GUID \
33 0x467313de, 0x4e30, 0x43f1, { 0x94, 0x3e, 0x32, 0x3f, 0x89, 0x84, 0x5d, 0xb5 } \
36 typedef struct _EFI_BLUETOOTH_IO_PROTOCOL EFI_BLUETOOTH_IO_PROTOCOL
;
39 /// EFI_BLUETOOTH_DEVICE_INFO
43 /// The version of the structure
47 /// 48bit Bluetooth device address.
49 BLUETOOTH_ADDRESS BD_ADDR
;
51 /// Bluetooth PageScanRepetitionMode. See Bluetooth specification for detail.
53 UINT8 PageScanRepetitionMode
;
55 /// Bluetooth ClassOfDevice. See Bluetooth specification for detail.
57 BLUETOOTH_CLASS_OF_DEVICE ClassOfDevice
;
59 /// Bluetooth CloseOffset. See Bluetooth specification for detail.
63 /// Bluetooth RSSI. See Bluetooth specification for detail.
67 /// Bluetooth ExtendedInquiryResponse. See Bluetooth specification for detail.
69 UINT8 ExtendedInquiryResponse
[240];
70 } EFI_BLUETOOTH_DEVICE_INFO
;
73 Get Bluetooth device information.
75 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
76 @param[out] DeviceInfoSize A pointer to the size, in bytes, of the DeviceInfo buffer.
77 @param[out] DeviceInfo A pointer to a callee allocated buffer that returns Bluetooth device information.
79 @retval EFI_SUCCESS The Bluetooth device information is returned successfully.
80 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the Bluetooth device information.
85 (EFIAPI
*EFI_BLUETOOTH_IO_GET_DEVICE_INFO
)(
86 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
87 OUT UINTN
*DeviceInfoSize
,
92 Get Bluetooth SDP information.
94 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
95 @param[out] SdpInfoSize A pointer to the size, in bytes, of the SdpInfo buffer.
96 @param[out] SdpInfo A pointer to a callee allocated buffer that returns Bluetooth SDP information.
98 @retval EFI_SUCCESS The Bluetooth device information is returned successfully.
99 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the Bluetooth SDP information.
104 (EFIAPI
*EFI_BLUETOOTH_IO_GET_SDP_INFO
)(
105 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
106 OUT UINTN
*SdpInfoSize
,
111 Send L2CAP message (including L2CAP header).
113 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
114 @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
115 On output, indicates the amount of data actually transferred.
116 @param[in] Buffer A pointer to the buffer of data that will be transmitted to Bluetooth L2CAP layer.
117 @param[in] Timeout Indicating the transfer should be completed within this time frame. The units are in
118 milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
119 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
121 @retval EFI_SUCCESS The L2CAP message is sent successfully.
122 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
123 - BufferSize is NULL.
126 @retval EFI_TIMEOUT Sending L2CAP message fail due to timeout.
127 @retval EFI_DEVICE_ERROR Sending L2CAP message fail due to host controller or device error.
132 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_RAW_SEND
)(
133 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
134 IN OUT UINTN
*BufferSize
,
140 Receive L2CAP message (including L2CAP header).
142 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
143 @param[in] BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
144 On output, indicates the amount of data actually transferred.
145 @param[out] Buffer A pointer to the buffer of data that will be received from Bluetooth L2CAP layer.
146 @param[in] Timeout Indicating the transfer should be completed within this time frame. The units are in
147 milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
148 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
150 @retval EFI_SUCCESS The L2CAP message is received successfully.
151 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
152 - BufferSize is NULL.
155 @retval EFI_TIMEOUT Receiving L2CAP message fail due to timeout.
156 @retval EFI_DEVICE_ERROR Receiving L2CAP message fail due to host controller or device error.
161 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_RAW_RECEIVE
)(
162 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
163 IN OUT UINTN
*BufferSize
,
169 Callback function, it is called when asynchronous transfer is completed.
171 @param[in] ChannelID Bluetooth L2CAP message channel ID.
172 @param[in] Data Data received via asynchronous transfer.
173 @param[in] DataLength The length of Data in bytes, received via asynchronous transfer.
174 @param[in] Context Context passed from asynchronous transfer request.
176 @retval EFI_SUCCESS The callback function complete successfully.
181 (EFIAPI
*EFI_BLUETOOTH_IO_ASYNC_FUNC_CALLBACK
) (
189 Receive L2CAP message (including L2CAP header) in non-blocking way.
191 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
192 @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.
193 @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.
194 @param[in] DataLength Specifies the length, in bytes, of the data to be received.
195 @param[in] Callback The callback function. This function is called if the asynchronous transfer is
197 @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
199 @retval EFI_SUCCESS The L2CAP asynchronous receive request is submitted successfully.
200 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
202 - If IsNewTransfer is TRUE, and an asynchronous receive request already exists.
207 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_RAW_ASYNC_RECEIVE
)(
208 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
209 IN BOOLEAN IsNewTransfer
,
210 IN UINTN PollingInterval
,
212 IN EFI_BLUETOOTH_IO_ASYNC_FUNC_CALLBACK Callback
,
217 Send L2CAP message (excluding L2CAP header) to a specific channel.
219 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
220 @param[in] Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to send.
221 @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
222 On output, indicates the amount of data actually transferred.
223 @param[in] Buffer A pointer to the buffer of data that will be transmitted to Bluetooth L2CAP layer.
224 @param[in] Timeout Indicating the transfer should be completed within this time frame. The units are in
225 milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
226 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
228 @retval EFI_SUCCESS The L2CAP message is sent successfully.
229 @retval EFI_NOT_FOUND Handle is invalid or not found.
230 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
231 - BufferSize is NULL.
234 @retval EFI_TIMEOUT Sending L2CAP message fail due to timeout.
235 @retval EFI_DEVICE_ERROR Sending L2CAP message fail due to host controller or device error.
240 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_SEND
)(
241 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
242 IN EFI_HANDLE Handle
,
243 IN OUT UINTN
*BufferSize
,
249 Receive L2CAP message (excluding L2CAP header) from a specific channel.
251 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
252 @param[in] Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to receive.
253 @param[out] BufferSize Indicates the size, in bytes, of the data buffer specified by Buffer.
254 @param[out] Buffer A pointer to the buffer of data that will be received from Bluetooth L2CAP layer.
255 @param[in] Timeout Indicating the transfer should be completed within this time frame. The units are in
256 milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
257 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
259 @retval EFI_SUCCESS The L2CAP message is received successfully.
260 @retval EFI_NOT_FOUND Handle is invalid or not found.
261 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
262 - BufferSize is NULL.
265 @retval EFI_TIMEOUT Receiving L2CAP message fail due to timeout.
266 @retval EFI_DEVICE_ERROR Receiving L2CAP message fail due to host controller or device error.
271 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_RECEIVE
)(
272 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
273 IN EFI_HANDLE Handle
,
274 OUT UINTN
*BufferSize
,
280 Callback function, it is called when asynchronous transfer is completed.
282 @param[in] Data Data received via asynchronous transfer.
283 @param[in] DataLength The length of Data in bytes, received via asynchronous transfer.
284 @param[in] Context Context passed from asynchronous transfer request.
286 @retval EFI_SUCCESS The callback function complete successfully.
291 (EFIAPI
*EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK
) (
298 Receive L2CAP message (excluding L2CAP header) in non-blocking way from a specific channel.
300 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
301 @param[in] Handel A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel
303 @param[in] Callback The callback function. This function is called if the asynchronous transfer is
305 @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
307 @retval EFI_SUCCESS The L2CAP asynchronous receive request is submitted successfully.
308 @retval EFI_NOT_FOUND Handle is invalid or not found.
309 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
311 - If an asynchronous receive request already exists on same Handle.
316 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_ASYNC_RECEIVE
)(
317 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
318 IN EFI_HANDLE Handle
,
319 IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback
,
326 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
327 @param[out] Handel A handle to indicate this L2CAP connection.
328 @param[in] Psm Bluetooth PSM. See Bluetooth specification for detail.
329 @param[in] Mtu Bluetooth MTU. See Bluetooth specification for detail.
330 @param[in] Callback The callback function. This function is called whenever there is message received
332 @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
334 @retval EFI_SUCCESS The Bluetooth L2CAP layer connection is created successfully.
335 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
337 @retval EFI_DEVICE_ERROR A hardware error occurred trying to do Bluetooth L2CAP connection.
342 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_CONNECT
)(
343 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
344 OUT EFI_HANDLE
*Handle
,
347 IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback
,
352 Do L2CAP disconnection.
354 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
355 @param[in] Handel A handle to indicate this L2CAP connection.
357 @retval EFI_SUCCESS The Bluetooth L2CAP layer is disconnected successfully.
358 @retval EFI_NOT_FOUND Handle is invalid or not found.
359 @retval EFI_DEVICE_ERROR A hardware error occurred trying to do Bluetooth L2CAP disconnection.
364 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_DISCONNECT
)(
365 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
370 Register L2CAP callback function for special channel.
372 @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
373 @param[out] Handel A handle to indicate this L2CAP connection.
374 @param[in] Psm Bluetooth PSM. See Bluetooth specification for detail.
375 @param[in] Mtu Bluetooth MTU. See Bluetooth specification for detail.
376 @param[in] Callback The callback function. This function is called whenever there is message received
377 in this channel. NULL means unregister.
378 @param[in] Context Data passed into Callback function. This is optional parameter and may be NULL.
380 @retval EFI_SUCCESS The Bluetooth L2CAP callback function is registered successfully.
381 @retval EFI_ALREADY_STARTED The callback function already exists when register.
382 @retval EFI_NOT_FOUND The callback function does not exist when unregister.
387 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_REGISTER_SERVICE
)(
388 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
389 OUT EFI_HANDLE
*Handle
,
392 IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback
,
397 /// This protocol provides service for Bluetooth L2CAP (Logical Link Control and Adaptation Protocol)
398 /// and SDP (Service Discovery Protocol).
400 struct _EFI_BLUETOOTH_IO_PROTOCOL
{
401 EFI_BLUETOOTH_IO_GET_DEVICE_INFO GetDeviceInfo
;
402 EFI_BLUETOOTH_IO_GET_SDP_INFO GetSdpInfo
;
403 EFI_BLUETOOTH_IO_L2CAP_RAW_SEND L2CapRawSend
;
404 EFI_BLUETOOTH_IO_L2CAP_RAW_RECEIVE L2CapRawReceive
;
405 EFI_BLUETOOTH_IO_L2CAP_RAW_ASYNC_RECEIVE L2CapRawAsyncReceive
;
406 EFI_BLUETOOTH_IO_L2CAP_SEND L2CapSend
;
407 EFI_BLUETOOTH_IO_L2CAP_RECEIVE L2CapReceive
;
408 EFI_BLUETOOTH_IO_L2CAP_ASYNC_RECEIVE L2CapAsyncReceive
;
409 EFI_BLUETOOTH_IO_L2CAP_CONNECT L2CapConnect
;
410 EFI_BLUETOOTH_IO_L2CAP_DISCONNECT L2CapDisconnect
;
411 EFI_BLUETOOTH_IO_L2CAP_REGISTER_SERVICE L2CapRegisterService
;
414 extern EFI_GUID gEfiBluetoothIoServiceBindingProtocolGuid
;
415 extern EFI_GUID gEfiBluetoothIoProtocolGuid
;