1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (C) 2021 Robin Krahl <robin.krahl@ireas.org>
// SPDX-License-Identifier: Apache-2.0 or MIT

//! Data types for the CTAPHID protocol.
//!
//! See [§ 11.2 of the CTAP specification][spec] for more information.
//!
//! [spec]: https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#usb-channels

#![warn(
    missing_copy_implementations,
    missing_debug_implementations,
    missing_docs,
    non_ascii_idents,
    trivial_casts,
    unused,
    unused_qualifications,
    clippy::expect_used,
    clippy::unwrap_used
)]
#![deny(unsafe_code)]
#![cfg_attr(not(feature = "std"), no_std)]

mod channel;
mod command;
mod error;
mod message;
mod packet;
mod response;
mod transaction;
mod util;

pub use channel::Channel;
pub use command::{Command, VendorCommand};
pub use error::{
    DefragmentationError, DeviceError, FragmentationError, ParseError, SerializationError,
};
pub use message::{DefragmentedMessage, Fragments, Message, PartialMessage};
pub use packet::{ContinuationPacket, InitializationPacket, Packet, PacketType};
pub use response::{Capabilities, DeviceVersion, InitResponse};
pub use transaction::Transaction;

/// The CTAPHID protocol version implemented by this crate.
pub const PROTOCOL_VERSION: u8 = 2;