MCPcopy Create free account
hub / github.com/OpenActionAPI/rust-elgato-streamdeck / serial_number

Method serial_number

src/lib.rs:154–172  ·  view source on GitHub ↗

Returns serial number of the device

(&self)

Source from the content-addressed store, hash-verified

152
153 /// Returns serial number of the device
154 pub fn serial_number(&self) -> Result<String, StreamDeckError> {
155 match self.kind {
156 Kind::Original | Kind::Mini => {
157 let bytes = get_feature_report(&self.device, 0x03, 17)?;
158 Ok(extract_str(&bytes[5..])?)
159 }
160
161 Kind::MiniMk2 | Kind::MiniDiscord | Kind::MiniMk2Module => {
162 let bytes = get_feature_report(&self.device, 0x03, 32)?;
163 Ok(extract_str(&bytes[5..])?)
164 }
165
166 _ => {
167 let bytes = get_feature_report(&self.device, 0x06, 32)?;
168 Ok(extract_str(&bytes[2..])?)
169 }
170 }
171 .map(|s| s.replace('\u{0001}', ""))
172 }
173
174 /// Returns firmware version of the StreamDeck
175 pub fn firmware_version(&self) -> Result<String, StreamDeckError> {

Callers 1

list_devicesFunction · 0.45

Calls 2

get_feature_reportFunction · 0.85
extract_strFunction · 0.85

Tested by

no test coverage detected