pub struct Modem { /* private fields */ }

Implementations§

source§

impl Modem

source

pub fn manufacturer(&self) -> Result<String, Error>

The equipment manufacturer, as reported by the modem.

Examples found in repository?
examples/network.rs (line 39)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn model(&self) -> Result<String, Error>

The equipment model, as reported by the modem.

Examples found in repository?
examples/network.rs (line 38)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn carrier_configuration(&self) -> Result<String, Error>

The description of the carrier-specific configuration (MCFG) in use by the modem.

Examples found in repository?
examples/network.rs (line 45)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn device(&self) -> Result<String, Error>

The physical modem device reference (ie, USB, PCI, PCMCIA device), which may be dependent upon the operating system.

In Linux for example, this points to a sysfs path of the usb_device object.

This value may also be set by the user using the MM_ID_PHYSDEV_UID udev tag (e.g. binding the tag to a specific sysfs path).

Examples found in repository?
examples/network.rs (line 40)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn state(&self) -> Result<ModemState, Error>

Overall state of the modem, given as a MMModemState value.

If the device’s state cannot be determined, MM_MODEM_STATE_UNKNOWN will be reported.

Examples found in repository?
examples/network.rs (line 50)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn access_techs(&self) -> Result<ModemAccessTechs, Error>

The current network access technologies used by the device to communicate with the network.

If the device’s access technology cannot be determined, Unknown will be reported.

source

pub fn signal_quality(&self) -> Result<(u32, bool), Error>

Signal quality in percent (0 - 100) of the dominant access technology the device is using to communicate with the network. Always 0 for POTS devices.
The additional boolean value indicates if the quality value given was recently taken.

Examples found in repository?
examples/network.rs (line 51)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn supported_modes(&self) -> Result<Vec<(ModemMode, ModemMode)>, Error>

This property exposes the supported mode combinations, given as an array of unsigned integer pairs, where:

The first integer is a bitmask of MMModemMode values, specifying the allowed modes.

The second integer is a single MMModemMode, which specifies the preferred access technology, among the ones defined in the allowed modes.

source

pub fn current_modes(&self) -> Result<(ModemMode, ModemMode), Error>

A pair of MMModemMode values, where the first one is a bitmask specifying the access technologies (eg 2G/3G/4G) the device is currently allowed to use when connecting to a network, and the second one is the preferred mode of those specified as allowed.

Examples found in repository?
examples/network.rs (line 54)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn set_current_modes( &self, (allowed, preferred): (ModemMode, ModemMode) ) -> Result<(), Error>

Set the access technologies (e.g. 2G/3G/4G preference) the device is currently allowed to use when connecting to a network.

The given combination should be supported by the modem, as specified in the “SupportedModes” property.

A pair of MMModemMode values, where the first one is a bitmask of allowed modes, and the second one the preferred mode, if any.

source

pub fn supported_bands(&self) -> Result<Vec<ModemBand>, Error>

List of MMModemBand values, specifying the radio frequency and technology bands supported by the device.

For POTS devices, only the MM_MODEM_BAND_ANY mode will be returned.

source

pub fn current_bands(&self) -> Result<Vec<ModemBand>, Error>

List of MMModemBand values, specifying the radio frequency and technology bands the device is currently using when connecting to a network.

It must be a subset of “SupportedBands”.

Examples found in repository?
examples/network.rs (line 73)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn set_current_bands(&self, bands: &[ModemBand]) -> Result<(), Error>

Set the radio frequency and technology bands the device is currently allowed to use when connecting to a network.

List of MMModemBand values, to specify the bands to be used.

source

pub fn signal_setup(&self, rate: u32) -> Result<(), Error>

Examples found in repository?
examples/network.rs (line 76)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn signal_cdma(&self) -> Result<SignalCdma, Error>

Available signal information for the CDMA1x access technology.

Examples found in repository?
examples/network.rs (line 79)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn signal_evdo(&self) -> Result<SignalEvdo, Error>

Available signal information for the CDMA EV-DO access technology.

Examples found in repository?
examples/network.rs (line 83)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn signal_gsm(&self) -> Result<SignalGsm, Error>

Available signal information for the GSM/GPRS access technology.

Examples found in repository?
examples/network.rs (line 87)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn signal_umts(&self) -> Result<SignalUmts, Error>

Available signal information for the UMTS (WCDMA) access technology.

Examples found in repository?
examples/network.rs (line 91)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn signal_lte(&self) -> Result<SignalLte, Error>

Available signal information for the LTE access technology.

Examples found in repository?
examples/network.rs (line 95)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn signal_nr5g(&self) -> Result<SignalNr5g, Error>

Available signal information for the 5G access technology.

Examples found in repository?
examples/network.rs (line 99)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
fn main() {

	let dbus = NetworkManager::connect().unwrap();

	for device in dbus.devices().unwrap() {
		let state = device.state().unwrap();
		let kind = device.kind().unwrap();
		let interface = device.interface().unwrap();

		println!("{:?} {:?} {:?}", interface, kind, state);
		if let Ok(apn) = device.modem_apn() {
			println!("- has apn {:?}", apn);
		}

		if matches!(state, DeviceState::Activated) {
			let ipv4 = device.ipv4_config().unwrap()
				.addresses().unwrap();
			println!("- addresses {:?}", ipv4);
		}
	}

	let dbus = ModemManager::connect().unwrap();

	for modem in dbus.modems().unwrap() {
		println!(
			"modem {:?} {:?} {:?}",
			modem.model().unwrap(),
			modem.manufacturer().unwrap(),
			modem.device().unwrap()
		);

		println!(
			"- carrier configuration: {:?}",
			modem.carrier_configuration().unwrap()
		);

		println!(
			"- state: {:?}, signal: {:?}",
			modem.state().unwrap(),
			modem.signal_quality().unwrap()
		);

		let (allowed_modes, preffered_modes) = modem.current_modes().unwrap();
		println!(
			"- allowed modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			allowed_modes.has_2g(),
			allowed_modes.has_3g(),
			allowed_modes.has_4g(),
			allowed_modes.has_5g()
		);

		println!(
			"- prefered modes: 2g: {} 3g: {} 4g: {} 5g: {}",
			preffered_modes.has_2g(),
			preffered_modes.has_3g(),
			preffered_modes.has_4g(),
			preffered_modes.has_5g()
		);

		println!(
			"- bands: {:?}",
			modem.current_bands().unwrap()
		);

		modem.signal_setup(10).unwrap();
		thread::sleep(Duration::from_secs(1));

		if let Ok(cdma) = modem.signal_cdma() {
			println!("- cdma: {:?}", cdma);
		}

		if let Ok(evdo) = modem.signal_evdo() {
			println!("- evdo: {:?}", evdo);
		}

		if let Ok(gsm) = modem.signal_gsm() {
			println!("- gsm: {:?}", gsm);
		}

		if let Ok(umts) = modem.signal_umts() {
			println!("- umts: {:?}", umts);
		}

		if let Ok(lte) = modem.signal_lte() {
			println!("- lte: {:?}", lte);
		}

		if let Ok(nr5g) = modem.signal_nr5g() {
			println!("- nr5g: {:?}", nr5g);
		}
	}

}
source

pub fn own_numbers(&self) -> Result<Vec<String>, Error>

List of numbers (e.g. MSISDN in 3GPP) being currently handled by this modem.

source

pub fn imei(&self) -> Result<String, Error>

The IMEI of the device.

Note

This interface will only be available once the modem is ready to be registered in the cellular network. 3GPP devices will require a valid unlocked SIM card before any of the features in the interface can be used.

source

pub fn operator_name(&self) -> Result<String, Error>

Name of the operator to which the mobile is currently registered.

If the operator name is not known or the mobile is not registered to a mobile network, this property will be an empty string.

Note

This interface will only be available once the modem is ready to be registered in the cellular network. 3GPP devices will require a valid unlocked SIM card before any of the features in the interface can be used.

source

pub fn sim(&self) -> Result<Sim, Error>

This SIM object is the one used for network registration and data connection setup.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Modem

§

impl !Send for Modem

§

impl !Sync for Modem

§

impl Unpin for Modem

§

impl !UnwindSafe for Modem

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.