// This file is part of security-keys-rust. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/security-keys-rust/master/COPYRIGHT. No part of security-keys-rust, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2021 The developers of security-keys-rust. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/security-keys-rust/master/COPYRIGHT.


/// Side band protocol.
#[derive(Debug, Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)]
#[derive(Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub enum SideBandProtocol
{
	#[allow(missing_docs)]
	Undefined,
	
	#[allow(missing_docs)]
	PresentationTimestamp,
	
	#[allow(missing_docs)]
	Unrecognized { protocol: u8 },
}

impl SideBandProtocol
{
	#[inline(always)]
	fn parse(protocol: u8) -> Self
	{
		use SideBandProtocol::*;
		
		match protocol
		{
			0 => Undefined,
			
			1 => PresentationTimestamp,
			
			_ => Unrecognized { protocol },
		}
	}
}
