Bluetooth specification says that L2CA request must block until response
is ready.
L2CAP node uses
field from Netgraph message header to match L2CA request and response.
The upper layer protocol must populate
.
L2CAP node will queue request and start processing.
Later, when response is
ready or timeout has occurred, L2CAP node will create new Netgraph message, set
flag and send message to the upper layer.
Note that L2CA indication messages
will not populate
flag.
There is no reason for this, because they are just notifications and do
not require acknowledgment.
NGM_L2CAP_L2CA_CON
|
|
Requests the creation of a channel representing a logical connection to a
physical address.
Input parameters are the target protocol (PSM) and remote
device's 48-bit address (BD_ADDR).
Output parameters are the local CID (LCID)
allocated by the local L2CAP entity, and Result of the request.
If Result
indicates a pending notification, the Status value may contain more information
of what processing is delaying the establishment of the connection.
|
NGM_L2CAP_L2CA_CON_IND
|
|
This message includes the parameters for the address of the remote device that
issued the connection request, the local CID representing the channel being
requested, the Identifier contained in the request, and the PSM value the
request is targeting.
|
NGM_L2CAP_L2CA_CON_RSP
|
|
Issues a response to a connection request event indication.
Input parameters
are the remote device's 48-bit address, Identifier sent in the request, local
CID, the Response code, and the Status attached to the Response code.
The output parameter is the Result of the service request.
This primitive must be
called no more than once after receiving the indication.
|
NGM_L2CAP_L2CA_CFG
|
|
Requests the initial configuration (or reconfiguration) of a channel to a new
set of channel parameters.
Input parameters are the local CID endpoint, new
incoming receivable MTU (InMTU), new outgoing flow spec-ification, and flush
and link timeouts.
Output parameters are the Result, accepted incoming MTU
(InMTU), the remote side's flow requests, and flush and link timeouts.
|
NGM_L2CAP_L2CA_CFG_IND
|
|
This message includes the parameters indicating the local CID of the channel
the request has been sent to, the outgoing MTU size (maximum packet that can
be sent across the channel) and the flowspec describing the characteristics of
the incoming data.
All other channel parameters are set to their default values
if not provided by the remote device.
|
NGM_L2CAP_L2CA_CFG_RSP
|
|
Issues a response to a configuration request event indication.
Input parameters
include the local CID of the endpoint being configured, outgoing transmit MTU
(which may be equal or less to the OutMTU parameter in the configuration
indication event) and the accepted flowspec for incoming traffic.
The output parameter is the Result value.
|
NGM_L2CAP_L2CA_QOS_IND
|
|
This message includes the parameter indicating the address of the remote
Bluetooth device where the QoS contract has been violated.
|
NGM_L2CAP_L2CA_DISCON
|
|
Requests the disconnection of the channel.
Input parameter is the CID representing the local channel endpoint.
Output parameter is Result.
Result
is zero if an L2CAP Disconnect Response is received, otherwise a non-zero value
is returned.
Once disconnection has been requested, no process will be able to
successfully read or write from the CID.
|
NGM_L2CAP_L2CA_DISCON_IND
|
|
This message includes the parameter indicating the local CID the request has
been sent to.
|
NGM_L2CAP_L2CA_WRITE
|
|
Response to transfer of data request.
Actual data must be received from
appropriate upstream hook and must be prepended with header defined as follows.
/* L2CA data packet header */
typedef struct {
uint32_t token; /* token to use in L2CAP_L2CA_WRITE */
uint16_t length; /* length of the data */
uint16_t lcid; /* local channel ID */
} __attribute__ ((packed)) ng_l2cap_l2ca_hdr_t;
The output parameters are Result and Length of data written.
|
NGM_L2CAP_L2CA_GRP_CREATE
|
|
Requests the creation of a CID to represent a logical connection to multiple
devices.
Input parameter is the PSM value that the outgoing connectionless
traffic is labelled with, and the filter used for incoming traffic.
Output parameter is the CID representing the local endpoint.
On creation, the group
is empty but incoming traffic destined for the PSM value is readable.
This request has not been implemented.
|
NGM_L2CAP_L2CA_GRP_CLOSE
|
|
The use of this message closes down a Group.
This request has not been implemented.
|
NGM_L2CAP_L2CA_GRP_ADD_MEMBER
|
|
Requests the addition of a member to a group.
The input parameter includes the
CID representing the group and the BD_ADDR of the group member to be added.
The output parameter Result confirms the success or failure of the request.
This request has not been implemented.
|
NGM_L2CAP_L2CA_GRP_REM_MEMBER
|
|
Requests the removal of a member from a group.
The input parameters include
the CID representing the group and BD_ADDR of the group member to be removed.
The output parameter Result confirms the success or failure of the request.
This request has not been implemented.
|
NGM_L2CAP_L2CA_GRP_MEMBERSHIP
|
|
Requests a report of the members of a group.
The input parameter CID represents the group being queried.
The output parameter Result confirms the success or
failure of the operation.
If the Result is successful, BD_ADDR_Lst is a list
of the Bluetooth addresses of the N members of the group.
This request has not been implemented.
|
NGM_L2CAP_L2CA_PING
|
|
Initiates an L2CA Echo Request message and the reception of the corresponding
L2CAP Echo Response message.
The input parameters are remote Bluetooth device
BD_ADDR, Echo Data and Length of the echo data.
The output parameters are
Result, Echo Data and Length of the echo data.
|
NGM_L2CAP_L2CA_GET_INFO
|
|
Initiates an L2CA Information Request message and the reception of the
corresponding L2CAP Info Response message.
The input parameters are remote Bluetooth device BD_ADDR and Information Type.
The output parameters are
Result, Information Data and Size of the information data.
|
NGM_L2CAP_L2CA_ENABLE_CLT
|
|
Request to disable (enable) the reception of connectionless packets.
The input
parameter is the PSM value indicating service that should be blocked
(unblocked) and Enable flag.
|