// bthddi.h
struct _BRB_L2CA_OPEN_ENHANCED_CHANNEL {
BRB_HEADER Hdr;
L2CAP_CHANNEL_HANDLE ChannelHandle;
union {
struct {
USHORT Response;
USHORT ResponseStatus;
};
USHORT Psm;
};
ULONG ChannelFlags;
BTH_ADDR BtAddress;
struct {
ULONG Flags;
L2CAP_CONFIG_VALUE_RANGE Mtu;
L2CAP_CONFIG_VALUE_RANGE FlushTO;
L2CAP_FLOWSPEC Flow;
USHORT LinkTO;
ULONG NumExtraOptions;
PL2CAP_CONFIG_OPTION ExtraOptions;
struct {
UCHAR ServiceType;
ULONG Latency;
} LocalQos;
struct {
ULONG Flags;
L2CAP_RETRANSMISSION_AND_FLOW_CONTROL RetransmissionAndFlow;
} ModeConfig;
USHORT Fcs;
L2CAP_EXTENDED_FLOW_SPEC ExtendedFlowSpec;
USHORT ExtendedWindowSize;
} ConfigOut;
struct {
ULONG Flags;
L2CAP_CONFIG_VALUE_RANGE Mtu;
L2CAP_CONFIG_RANGE FlushTO;
} ConfigIn;
ULONG CallbackFlags;
PFNBTHPORT_INDICATION_CALLBACK_ENHANCED Callback;
PVOID CallbackContext;
PVOID ReferenceObject;
CHANNEL_CONFIG_RESULTS_ENHANCED OutResults;
CHANNEL_CONFIG_RESULTS_ENHANCED InResults;
UCHAR IncomingQueueDepth;
PVOID Reserved;
};
View the official Windows Driver Kit DDI referenceNo description available.
The _BRB_L2CA_OPEN_ENHANCED_CHANNEL structure is used to open an enhanced L2CAP channel to a remote device, or send a response for accepting/rejecting an incoming enhanced L2CAP connection request that was initiated by a remote device.
HdrA BRB_HEADER structure that contains information about the current BRB.
ChannelHandleHandle used to identify the connection upon a successful connect. When sending a BRB_L2CA_OPEN_CHANNEL, this will be filled in when the BRB completes. When sending a BRB_L2CA_OPEN_CHANNEL_RESPONSE request, this must be filled in by the server before sending down the BRB. The value assigned should be INDICATION_PARAMETERS::ConnectionHandle which was passed in during the IndicationRemoteConnect.
ResponseUsed only with BRB_L2CA_OPEN_CHANNEL_RESPONSE. One of the CONNECT_RSP_RESULT_Xxx values is used.
If the BRB returns with a status of STATUS_REQUEST_NOT_ACCEPTED, then Response will contain the negative response from the remote host.
ResponseStatusIf Response is equal to CONNECT_RSP_RESULT_PENDING, then this field is valid. One of the CONNECT_RSP_STATUS_XXX values is used.
PsmThe Protocol/Service Multiplexer (PSM) that the channel uses to connect to the remote device. When used with a BRB_L2CA_OPEN_ENHANCED_CHANNEL request, this member is set as an input field. When used with a BRB_L2CA_OPEN_ENHANCED_CHANNEL_RESPONSE request, this member is used as an output field.
ChannelFlagsFlags that specify the requirements for the channel to be opened. Valid flag values are listed in the following table:
| Flag | Description |
|---|---|
| CF_LINK_AUTHENTICATED | The link must be authenticated. |
| CF_LINK_ENCRYPTED | The link must be encrypted. Setting this flag also sets the CF_LINK_AUTHENTICATED flag. |
| CF_LINK_SUPPRESS_PIN | The profile driver indicates its preference that users not be prompted for a PIN. |
BtAddressThe Bluetooth address of the device for which the connection is intended.
ConfigOutThe substructure that contains parameter settings for a BRB_L2CA_OPEN_ENHANCED_CHANNEL BRB sent to a remote device.
ConfigOut.FlagsFlags that specify the requirements for the channel to be opened. Valid flag values are listed in the following table:
| Flag | Description |
|---|---|
| CF_LINK_AUTHENTICATED | The link must be authenticated. |
| CF_LINK_ENCRYPTED | The link must be encrypted. Setting this flag also sets the CF_LINK_AUTHENTICATED flag. |
| CF_LINK_SUPPRESS_PIN | The profile driver indicates its preference that users not be prompted for a PIN. |
| CFG_ENHANCED | Specifies that the ModeConfig structure is valid. |
| CFG_FCS | Specifies that the Fcs value is valid. |
ConfigOut.MtuThe range of message transfer units (MTUs) that is used to negotiate the size of the outbound half of channel.
ConfigOut.FlushTOThe range of possible values to be used for the flush timeout for the outbound half of the channel.
ConfigOut.FlowReserved for future use. Do not use.
ConfigOut.LinkTOThe Link Manager link timeout.
ConfigOut.NumExtraOptionsThe number of array items that are contained in the ExtraOptions member. This value should be zero for most clients.
ConfigOut.ExtraOptionsExtra options. This value should be zero for most clients.
ConfigOut.LocalQosReserved for future use. Do not use.
ConfigOut.LocalQos.ServiceTypeReserved for future use. Do not use.
ConfigOut.LocalQos.LatencyReserved for future use. Do not use.
ConfigOut.ModeConfigSpecifies the type of L2CAP channel being opened. This structure is valid only if CFG_ENHANCED flag is specified.
ConfigOut.ModeConfig.FlagsSpecifies the type of L2CAP channel mode requested.
| Flag | Description |
|---|---|
| CM_BASIC | Open a basic mode channel. |
| CM_RETRANSMISSION_AND_FLOW | Open an enhanced retransmission mode channel. |
| CM_STREAMING | Open a streaming mode channel. |
ConfigOut.ModeConfig.RetransmissionAndFlowSpecifies the options for CM_RETRANSMISSION_AND_FLOW and CM_STREAMING modes. This structure must be zero if only CM_BASIC is specified in the Flags member.
The Mode submember of RetransmissionAndFlow should be set to 0. Use the ModeConfig submember of RetransmissionAndFlow to specify the type of channel to open.
ConfigOut.FcsSpecifies whether FCS should be used for the enhanced L2CAP channel. This value is valid only if CM_RETRANSMISSION_AND_FLOW or CM_STREAMING flag is specified in the Flags member.
ConfigOut.ExtendedFlowSpecNot supported.
ConfigOut.ExtendedWindowSizeNot supported.
ConfigInThe substructure that contains parameter settings to validate incoming BRB_L2CA_OPEN_ENHANCED_CHANNEL_RESPONSE BRBs that are sent from a remote device.
ConfigIn.FlagsFlags that specify the requirements for the channel to be opened. Valid flag values are listed in the following table:
| Flag | Description |
|---|---|
| CF_LINK_AUTHENTICATED | The link must be authenticated. |
| CF_LINK_ENCRYPTED | The link must be encrypted. Setting this flag also sets the CF_LINK_AUTHENTICATED flag. |
| CF_LINK_SUPPRESS_PIN | The profile driver indicates its preference that users not be prompted for a PIN. |
ConfigIn.MtuThe range of message transfer units (MTUs) that is used to negotiate the size of the inbound half of channel.
ConfigIn.FlushTOThe range of possible values to be used for the flush timeout for the inbound half of the channel.
CallbackFlagsA flag that specifies which events should generate a callback routine to notify the profile driver that the event has occurred. Valid flag values are contained in the following table.
| Flag | Description |
|---|---|
| CALLBACK_CONFIG_EXTRA_IN | If set, the callback routine will be called when the configuration request for the remote device contains extra options. If not set, the extra configuration options will be rejected as unknown options. This flag is used with BRB_L2CA_OPEN_ENHANCED_CHANNEL_RESPONSE BRBs. |
| CALLBACK_CONFIG_EXTRA_OUT | If set, the callback routine will be called when the remote device rejects an extra configuration option from a BRB_L2CA_OPEN_ENHANCED_CHANNEL request. If not set and the remote device rejects the configuration request due to an extra option, the connection will be closed. |
| CALLBACK_CONFIG_QOS | If set, the callback routine will be called when a remote device sends a configuration request that contains a QOS value. If this flag is not set and the remote device either sends QOS parameters in a configuration request or rejects the profile driver's requested QOS parameters, the connection is disconnected. |
| CALLBACK_DISCONNECT | If set, the callback routine will be called when a remote device disconnects from the enhanced L2CAP channel. |
| CALLBACK_RECV_PACKET | If set, the callback routine will be called when the profile driver receives an incoming enhanced L2CAP packet. |
CallbackThe Enhanced L2CAP Callback Function implemented by the profile driver, that the Bluetooth driver stack should call to notify the profile driver about any changes to the enhanced L2CAP connection.
CallbackContextThe context to pass to the callback function specified in the Callback member. The profile driver defines this value.
ReferenceObjectA pointer to an object to pass to ObReferenceObject and ObDereferenceObject for which to maintain a reference count.
OutResultsA CHANNEL_CONFIG_RESULTS_ENHANCED structure that contains configuration parameters negotiated for the outbound request.
InResultsA CHANNEL_CONFIG_RESULTS_ENHANCED structure that contains configuration parameters negotiated for the inbound request.
IncomingQueueDepthSpecifies the incoming queue length in message transfer units (MTUs).
ReservedReserved member. Do not use.
This member is used as an input parameter for a BRB_L2CA_OPEN_ENHANCED_CHANNEL request and an output parameter for the BRB_L2CA_OPEN_ENHANCED_CHANNEL_RESPONSE request.
For a BRB_L2CA_OPEN_ENHANCED_CHANNEL_RESPONSE request, this member holds a flag that indicates the profile driver's response to the remote device. Valid flag values are contained in the following table.
| Flag | Description |
|---|---|
| CONNECT_RSP_RESULT_NO_RESOURCES | The profile driver refused the connection due to a lack of resources. |
| CONNECT_RSP_RESULT_PENDING | The profile driver is currently busy and cannot accept the connection. Try again later. |
| CONNECT_RSP_RESULT_PSM_NEG | The profile driver refused the connection because the PSM is not supported. |
| CONNECT_RSP_RESULT_SECURITY_BLOCK | The profile driver refused the connection for security reasons. |
| CONNECT_RSP_RESULT_SUCCESS | The profile driver accepted the connection. |
For the BRB_L2CA_OPEN_ENHANCED_CHANNEL BRB, this member contains the response from the remote device to which the profile driver attempted to connect. Valid flag values are contained in the following table.
| Flag | Description |
|---|---|
| CONNECT_RSP_RESULT_NO_RESOURCES | The remote device refused the connection due to a lack of resources. |
| CONNECT_RSP_RESULT_PSM_NEG | The remote device refused the connection. |
| CONNECT_RSP_RESULT_SECURITY_BLOCK | The remote device refused the connection for security reasons. |
| CONNECT_RSP_RESULT_SUCCESS | The remote device accepted the connection. |
If during a call to the BRB_L2CA_OPEN_ENHANCED_CHANNEL_RESPONSE BRB the Response member is set to CONNECT_RSP_RESULT_PENDING, this member is valid and contains one of the following values:
Profile drivers can use CM_BASIC | CM_RETRANSMISSION_AND_FLOW, or CM_BASIC | CM_STREAMING modes for the Flags member. This indicates to open an enhanced retransmission mode, or streaming mode channel if possible, and if not fall back to basic mode channel.
A value of CM_RETRANSMISSION_AND_FLOW | CM_STREAMING is not supported.