ssp/host_protocol_version/
response.rs

1use crate::{
2    impl_default, impl_message_from_buf, impl_message_ops, impl_response_display,
3    impl_response_ops, len::HOST_PROTOCOL_VERSION_RESPONSE, message::MessageOps, MessageType,
4};
5
6/// HostProtocolVersion - Response (0x06)
7///
8/// Represents a response to an [HostProtocolVersionCommand](crate::HostProtocolVersionCommand) message.
9#[repr(C)]
10#[derive(Clone, Copy, Debug, PartialEq)]
11pub struct HostProtocolVersionResponse {
12    buf: [u8; HOST_PROTOCOL_VERSION_RESPONSE],
13}
14
15impl HostProtocolVersionResponse {
16    /// Creates a new [HostProtocolVersionResponse] message.
17    pub fn new() -> Self {
18        let mut msg = Self {
19            buf: [0u8; HOST_PROTOCOL_VERSION_RESPONSE],
20        };
21
22        msg.init();
23
24        msg
25    }
26}
27
28impl_default!(HostProtocolVersionResponse);
29impl_message_from_buf!(HostProtocolVersionResponse);
30impl_message_ops!(
31    HostProtocolVersionResponse,
32    MessageType::HostProtocolVersion
33);
34impl_response_ops!(HostProtocolVersionResponse);
35impl_response_display!(HostProtocolVersionResponse);