1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use heapless::String;

#[derive(Debug, Clone)]
pub enum Apn {
    Given(String<99>),
    Automatic,
}

impl Default for Apn {
    fn default() -> Self {
        Apn::Automatic
    }
}

#[derive(Debug, Clone, Default)]
pub struct APNInfo {
    pub apn: Apn,
    pub user_name: Option<String<64>>,
    pub password: Option<String<64>>,
}

impl APNInfo {
    pub fn new(apn: &str) -> Self {
        APNInfo {
            apn: Apn::Given(String::from(apn)),
            user_name: None,
            password: None,
        }
    }
}