Skip to content

Commit

Permalink
Merge pull request #18 from TheJebForge/master
Browse files Browse the repository at this point in the history
Make DeviceImage data be public
  • Loading branch information
ryankurte committed Mar 22, 2022
2 parents ae6a9a8 + 540bb1b commit 2cec1a8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ pub struct DeviceImage {
data: Vec<u8>,
}

impl DeviceImage {
/// Constructs [DeviceImage] from a byte array
pub fn from_bytes(data: Vec<u8>) -> Self {
Self::from(data)
}
}

impl From<Vec<u8>> for DeviceImage {
fn from(data: Vec<u8>) -> Self {
Self {
data
}
}
}

/// Device USB Product Identifiers (PIDs)
pub mod pids {
pub const ORIGINAL: u16 = 0x0060;
Expand Down

0 comments on commit 2cec1a8

Please sign in to comment.