pub struct PairResponseMessage {
pub result: Option<DeRecResult>,
pub sender_kind: i32,
pub communication_info: Option<CommunicationInfo>,
pub nonce: u64,
pub parameter_range: Option<ParameterRange>,
pub timestamp: Option<Timestamp>,
}Expand description
PairResponseMessage is the response to a PairRequestMessage.
§Purpose
This message completes the pairing handshake. It informs the initiator:
- whether the pairing was accepted or rejected
- the responder’s role and identity information
- the responder’s supported parameter range
§Differences from PairRequestMessage
- Does not include encryption public keys, as those were already exchanged via ContactMessage and PairRequestMessage
- Includes a Result field indicating success or failure
§Semantics
- If
resultindicates success, a secure channel is considered established - If
resultindicates failure, the pairing MUST be treated as unsuccessful and no further protocol messages should be exchanged on this channel
The nonce MUST match the value provided in the request, ensuring that the response corresponds to the same pairing session.
Fields§
§result: Option<DeRecResult>Result of processing the pairing request.
Indicates whether the pairing was successful or failed. Failure may occur due to:
- incompatible parameter ranges
- failed authentication at the application layer
- invalid or malformed request data
sender_kind: i32The role of the sender of this message.
This informs the initiator whether the responder is acting as an Owner or a Helper.
communication_info: Option<CommunicationInfo>Application-level identifying information of the responder.
Intended for user-facing identification and display purposes.
nonce: u64Nonce identifying the pairing session.
This value MUST exactly match the nonce received in the PairRequestMessage. A mismatch indicates an invalid or unrelated pairing attempt and SHOULD result in rejection.
parameter_range: Option<ParameterRange>Parameter range supported by the responder.
The initiator combines this with its own parameter range to determine the final agreed configuration for the channel.
timestamp: Option<Timestamp>Timestamp indicating when this message was created.
Used for observability and may assist in replay detection or timeout handling, depending on the implementation.
Implementations§
Source§impl PairResponseMessage
impl PairResponseMessage
Sourcepub fn sender_kind(&self) -> SenderKind
pub fn sender_kind(&self) -> SenderKind
Returns the enum value of sender_kind, or the default if the field is set to an invalid enum value.
Sourcepub fn set_sender_kind(&mut self, value: SenderKind)
pub fn set_sender_kind(&mut self, value: SenderKind)
Sets sender_kind to the provided enum value.
Trait Implementations§
Source§impl Clone for PairResponseMessage
impl Clone for PairResponseMessage
Source§fn clone(&self) -> PairResponseMessage
fn clone(&self) -> PairResponseMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PairResponseMessage
impl Debug for PairResponseMessage
Source§impl Default for PairResponseMessage
impl Default for PairResponseMessage
Source§impl Message for PairResponseMessage
impl Message for PairResponseMessage
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.