mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-05-30 22:44:15 +00:00
This type defines the (NetID derived) prefix that must be used when generating device addresses. This can be retrieved from the NetID, but it is also possible to define a prefix that defines a smaller address range within the NetID. See also #49.
23 lines
490 B
Rust
23 lines
490 B
Rust
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum Error {
|
|
#[error("NetID expects exactly 3 bytes")]
|
|
NetIdLength,
|
|
|
|
#[error("EUI64 expects exactly 8 bytes")]
|
|
Eui64Length,
|
|
|
|
#[error("AES128Key expects exactly 16 bytes")]
|
|
Aes128Length,
|
|
|
|
#[error("DevAddr expects exactly 4 bytes")]
|
|
DevAddrLength,
|
|
|
|
#[error("DevAddrPrefix must be in the form 00000000/0")]
|
|
DevAddrPrefixFormat,
|
|
|
|
#[error(transparent)]
|
|
FromHexError(#[from] hex::FromHexError),
|
|
}
|