pub struct SignalingCommand {
pub code: u8,
pub identifier: u8,
pub data_length: u16,
pub data: Vec<u8>,
}Expand description
L2CAP signaling command (within the signaling channel)
Fields§
§code: u8Command code
identifier: u8Identifier (for request/response matching)
data_length: u16Command data length
data: Vec<u8>Command-specific data
Implementations§
Source§impl SignalingCommand
impl SignalingCommand
Sourcepub fn connection_request(identifier: u8, psm: u16, source_cid: u16) -> Self
pub fn connection_request(identifier: u8, psm: u16, source_cid: u16) -> Self
Create a Connection Request command
Sourcepub fn connection_response(
identifier: u8,
dest_cid: u16,
source_cid: u16,
result: ConnectionResult,
status: u16,
) -> Self
pub fn connection_response( identifier: u8, dest_cid: u16, source_cid: u16, result: ConnectionResult, status: u16, ) -> Self
Create a Connection Response command
Sourcepub fn config_request(identifier: u8, dest_cid: u16, mtu: u16) -> Self
pub fn config_request(identifier: u8, dest_cid: u16, mtu: u16) -> Self
Create a Configuration Request command
Sourcepub fn disconnection_request(
identifier: u8,
dest_cid: u16,
source_cid: u16,
) -> Self
pub fn disconnection_request( identifier: u8, dest_cid: u16, source_cid: u16, ) -> Self
Create a Disconnection Request command
Sourcepub fn serialize(&self, buf: &mut [u8]) -> Result<usize, KernelError>
pub fn serialize(&self, buf: &mut [u8]) -> Result<usize, KernelError>
Serialize command to buffer, returns bytes written
Sourcepub fn parse(buf: &[u8]) -> Result<Self, KernelError>
pub fn parse(buf: &[u8]) -> Result<Self, KernelError>
Parse a signaling command from raw buffer
Trait Implementations§
Source§impl Clone for SignalingCommand
impl Clone for SignalingCommand
Source§fn clone(&self) -> SignalingCommand
fn clone(&self) -> SignalingCommand
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SignalingCommand
impl RefUnwindSafe for SignalingCommand
impl Send for SignalingCommand
impl Sync for SignalingCommand
impl Unpin for SignalingCommand
impl UnwindSafe for SignalingCommand
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)