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, 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 This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
76 @param DeviceInfoSize A pointer to the size, in bytes, of the DeviceInfo buffer.
77 @param 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 This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
95 @param SdpInfoSize A pointer to the size, in bytes, of the SdpInfo buffer.
96 @param 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 This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
114 @param 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 Buffer A pointer to the buffer of data that will be transmitted to Bluetooth L2CAP layer.
117 @param 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 This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
143 @param 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 Buffer A pointer to the buffer of data that will be received from Bluetooth L2CAP layer.
146 @param 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 ChannelID Bluetooth L2CAP message channel ID.
172 @param Data Data received via asynchronous transfer.
173 @param DataLength The length of Data in bytes, received via asynchronous transfer.
174 @param 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 This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
192 @param IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.
193 @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.
194 @param DataLength Specifies the length, in bytes, of the data to be received.
195 @param Callback The callback function. This function is called if the asynchronous transfer is
197 @param 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 This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
220 @param Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to send.
221 @param 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 Buffer A pointer to the buffer of data that will be transmitted to Bluetooth L2CAP layer.
224 @param 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 This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
252 @param Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to receive.
253 @param BufferSize Indicates the size, in bytes, of the data buffer specified by Buffer.
254 @param Buffer A pointer to the buffer of data that will be received from Bluetooth L2CAP layer.
255 @param 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 Data Data received via asynchronous transfer.
283 @param DataLength The length of Data in bytes, received via asynchronous transfer.
284 @param 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 This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
301 @param Handel A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to receive.
302 @param Callback The callback function. This function is called if the asynchronous transfer is
304 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
306 @retval EFI_SUCCESS The L2CAP asynchronous receive request is submitted successfully.
307 @retval EFI_NOT_FOUND Handle is invalid or not found.
308 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
310 - If an asynchronous receive request already exists on same Handle.
315 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_ASYNC_RECEIVE
)(
316 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
317 IN EFI_HANDLE Handle
,
318 IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback
,
325 @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
326 @param Handel A handle to indicate this L2CAP connection.
327 @param Psm Bluetooth PSM. See Bluetooth specification for detail.
328 @param Mtu Bluetooth MTU. See Bluetooth specification for detail.
329 @param Callback The callback function. This function is called whenever there is message received
331 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
333 @retval EFI_SUCCESS The Bluetooth L2CAP layer connection is created successfully.
334 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
336 @retval EFI_DEVICE_ERROR A hardware error occurred trying to do Bluetooth L2CAP connection.
341 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_CONNECT
)(
342 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
343 OUT EFI_HANDLE
*Handle
,
346 IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback
,
351 Do L2CAP disconnection.
353 @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
354 @param Handel A handle to indicate this L2CAP connection.
356 @retval EFI_SUCCESS The Bluetooth L2CAP layer is disconnected successfully.
357 @retval EFI_NOT_FOUND Handle is invalid or not found.
358 @retval EFI_DEVICE_ERROR A hardware error occurred trying to do Bluetooth L2CAP disconnection.
363 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_DISCONNECT
)(
364 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
369 Register L2CAP callback function for special channel.
371 @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
372 @param Handel A handle to indicate this L2CAP connection.
373 @param Psm Bluetooth PSM. See Bluetooth specification for detail.
374 @param Mtu Bluetooth MTU. See Bluetooth specification for detail.
375 @param Callback The callback function. This function is called whenever there is message received
376 in this channel. NULL means unregister.
377 @param Context Data passed into Callback function. This is optional parameter and may be NULL.
379 @retval EFI_SUCCESS The Bluetooth L2CAP callback function is registered successfully.
380 @retval EFI_ALREADY_STARTED The callback function already exists when register.
381 @retval EFI_NOT_FOUND The callback function does not exist when unregister.
386 (EFIAPI
*EFI_BLUETOOTH_IO_L2CAP_REGISTER_SERVICE
)(
387 IN EFI_BLUETOOTH_IO_PROTOCOL
*This
,
388 OUT EFI_HANDLE
*Handle
,
391 IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback
,
396 /// This protocol provides service for Bluetooth L2CAP (Logical Link Control and Adaptation Protocol)
397 /// and SDP (Service Discovery Protocol).
399 struct _EFI_BLUETOOTH_IO_PROTOCOL
{
400 EFI_BLUETOOTH_IO_GET_DEVICE_INFO GetDeviceInfo
;
401 EFI_BLUETOOTH_IO_GET_SDP_INFO GetSdpInfo
;
402 EFI_BLUETOOTH_IO_L2CAP_RAW_SEND L2CapRawSend
;
403 EFI_BLUETOOTH_IO_L2CAP_RAW_RECEIVE L2CapRawReceive
;
404 EFI_BLUETOOTH_IO_L2CAP_RAW_ASYNC_RECEIVE L2CapRawAsyncReceive
;
405 EFI_BLUETOOTH_IO_L2CAP_SEND L2CapSend
;
406 EFI_BLUETOOTH_IO_L2CAP_RECEIVE L2CapReceive
;
407 EFI_BLUETOOTH_IO_L2CAP_ASYNC_RECEIVE L2CapAsyncReceive
;
408 EFI_BLUETOOTH_IO_L2CAP_CONNECT L2CapConnect
;
409 EFI_BLUETOOTH_IO_L2CAP_DISCONNECT L2CapDisconnect
;
410 EFI_BLUETOOTH_IO_L2CAP_REGISTER_SERVICE L2CapRegisterService
;
413 extern EFI_GUID gEfiBluetoothIoServiceBindingProtocolGuid
;
414 extern EFI_GUID gEfiBluetoothIoProtocolGuid
;