fixed stream type and port number
This commit is contained in:
parent
e0d9fa444b
commit
746f13fb73
1 changed files with 4 additions and 4 deletions
|
|
@ -65,20 +65,20 @@ pub struct VirtualPort(u8);
|
|||
impl VirtualPort{
|
||||
#[inline]
|
||||
pub const fn get_stream_type(self) -> u8 {
|
||||
(self.0 & 0xF0) >> 4
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub const fn get_port_number(self) -> u8 {
|
||||
(self.0 & 0x0F)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub const fn get_port_number(self) -> u8 {
|
||||
(self.0 & 0xF0) >> 4
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn stream_type(self, val: u8) -> Self {
|
||||
let masked_val = val & 0x0F;
|
||||
let masked_val = val & 0xF0;
|
||||
assert_eq!(masked_val, val);
|
||||
|
||||
Self((self.0 & 0xF0) | masked_val)
|
||||
Self((self.0 & 0x0F) | masked_val)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue