Struct Plmn
pub struct Plmn {
mcc: [u8; 3],
mnc: [u8; 3],
three_digit_mnc: bool,
}Expand description
A network ID: the mobile country code (MCC) and mobile network code (MNC).
The MCC has three digits. The MNC has two or three digits. The leading
zero of a two digit MNC is kept, so 01 and 001 are different networks.
§Example
let plmn = ql_nas::Plmn::new("262", "01").expect("valid digits");
assert_eq!(plmn.mcc(), "262");
assert_eq!(plmn.mnc(), "01");Fields§
§mcc: [u8; 3]§mnc: [u8; 3]§three_digit_mnc: boolImplementations§
§impl Plmn
impl Plmn
pub fn new(mcc: &str, mnc: &str) -> Option<Self>
pub fn new(mcc: &str, mnc: &str) -> Option<Self>
Returns the network ID, or None if the MCC isn’t three ASCII digits
or the MNC isn’t two or three ASCII digits.
pub const fn has_three_digit_mnc(&self) -> bool
pub const fn has_three_digit_mnc(&self) -> bool
Returns whether the MNC has three digits.
pub(crate) fn from_ascii(mcc: [u8; 3], mnc: [u8; 3]) -> Option<Self>
pub(crate) fn from_ascii(mcc: [u8; 3], mnc: [u8; 3]) -> Option<Self>
Reads the ASCII form of nas_common_network_id_type_v01.
The third MNC byte is 0xFF or zero for a two digit MNC.
pub(crate) fn from_codes(
mcc: u16,
mnc: u16,
three_digit_mnc: bool,
) -> Option<Self>
pub(crate) fn from_codes( mcc: u16, mnc: u16, three_digit_mnc: bool, ) -> Option<Self>
Reads the numeric codes of nas_mnc_pcs_digit_include_status_type_v01.
Returns None if a code has too many digits.
pub(crate) fn from_bcd(bytes: [u8; 3]) -> Option<Self>
pub(crate) fn from_bcd(bytes: [u8; 3]) -> Option<Self>
Reads the BCD form from 3GPP TS 24.008 section 10.5.1.3.
The bytes hold MCC 2 and 1, MNC 3 and MCC 3, and MNC 2 and 1, high
nibble first. MNC 3 is 0xF for a two digit MNC.