MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / netid_type

Method netid_type

lrwn/src/devaddr.rs:213–221  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

211 }
212
213 pub fn netid_type(&self) -> Result<u8> {
214 for i in (0..=7).rev() {
215 if self.0[0] & (1 << i) == 0 {
216 return Ok(7 - i);
217 }
218 }
219
220 Err(anyhow!("Invalid type prefix value"))
221 }
222
223 pub fn nwkid(&self) -> Result<Vec<u8>> {
224 Ok(match self.netid_type()? {

Callers 1

nwkidMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected