pub trait L2capCommands {
// Required methods
async fn connection_parameter_update_request(
&mut self,
params: &ConnectionParameterUpdateRequest,
);
async fn connection_parameter_update_response(
&mut self,
params: &ConnectionParameterUpdateResponse,
);
async fn coc_connect(&mut self, params: &L2CapCocConnect);
async fn coc_connect_confirm(&mut self, params: &L2CapCocConnectConfirm);
async fn coc_reconfig(&mut self, params: &L2CapCocReconfig);
async fn coc_reconfig_confirm(&mut self, params: &L2CapCocReconfigConfirm);
async fn coc_disconnect(&mut self, channel_index: u8);
async fn coc_flow_control(&mut self, params: &L2CapCocFlowControl);
async fn coc_tx_data(&mut self, params: &L2CapCocTxData);
}
Expand description
L2Cap-specific commands.
Required Methods§
Sourceasync fn connection_parameter_update_request(
&mut self,
params: &ConnectionParameterUpdateRequest,
)
async fn connection_parameter_update_request( &mut self, params: &ConnectionParameterUpdateRequest, )
Send an L2CAP connection parameter update request from the peripheral to the central device.
§Errors
- Underlying communication errors.
§Generated events
A command status event on the receipt of the command and an L2CAP Connection Update Response event when the master responds to the request (accepts or rejects).
Sourceasync fn connection_parameter_update_response(
&mut self,
params: &ConnectionParameterUpdateResponse,
)
async fn connection_parameter_update_response( &mut self, params: &ConnectionParameterUpdateResponse, )
This command should be sent in response to the
L2CapConnectionUpdateResponse
event from the controller. The accept parameter has to be set to true if the connection
parameters given in the event are acceptable.
§Errors
Only underlying communication errors are reported.
§Generated events
A Command Complete event is generated.
Sourceasync fn coc_connect(&mut self, params: &L2CapCocConnect)
async fn coc_connect(&mut self, params: &L2CapCocConnect)
This command sends a Credit-Based Connection Request packet to the specified connection.
See Bluetooth Core specification Vol.3 Part A.
Sourceasync fn coc_connect_confirm(&mut self, params: &L2CapCocConnectConfirm)
async fn coc_connect_confirm(&mut self, params: &L2CapCocConnectConfirm)
This command sends a Credit-Based Connection Response packet. It must be used upon receipt of a connection request though L2CAP COC Connection event.
See Bluetooth Core specification Vol.3 Part A.
Sourceasync fn coc_reconfig(&mut self, params: &L2CapCocReconfig)
async fn coc_reconfig(&mut self, params: &L2CapCocReconfig)
This command sends a Credit-Based Reconfigure Request packet on the specified connection.
See Bluetooth Core specification Vol.3 Part A.
Sourceasync fn coc_reconfig_confirm(&mut self, params: &L2CapCocReconfigConfirm)
async fn coc_reconfig_confirm(&mut self, params: &L2CapCocReconfigConfirm)
This command sends a Credit-Based Reconfigure Response packet. It must be use upon receipt of a Credit-Based Reconfigure Request through L2CAP COC Reconfigure event.
See Bluetooth Core specification Vol.3 Part A.
Sourceasync fn coc_disconnect(&mut self, channel_index: u8)
async fn coc_disconnect(&mut self, channel_index: u8)
This command sends a Disconnection Request signaling packet on the specified connection-oriented channel.
See Bluetooth Core specification Vol.3 Part A.
§Generated events
A L2CAP COC Disconnection event is received when the disconnection of the channel is effective.
Sourceasync fn coc_flow_control(&mut self, params: &L2CapCocFlowControl)
async fn coc_flow_control(&mut self, params: &L2CapCocFlowControl)
This command sends a Flow Control Credit signaling packet on the specified connection-oriented channel.
See Bluetooth Core specification Vol.3 Part A.
Sourceasync fn coc_tx_data(&mut self, params: &L2CapCocTxData)
async fn coc_tx_data(&mut self, params: &L2CapCocTxData)
This command sends a K-frame packet on the specified connection-oriented channel.
See Bluetooth Core specification Vol.3 Part A.
§Note
for the first K-frame of the SDU, the Information data shall contain the L2CAP SDU Length coded on two octets followed by the K-frame information payload. For the next K-frames of the SDU, the Information data shall only contain the K-frame information payload. The Length value must not exceed (BLE_CMD_MAX_PARAM_LEN - 3) i.e. 252 for BLE_CMD_MAX_PARAM_LEN default value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.