aboutsummaryrefslogtreecommitdiff
path: root/embassy-net-nrf91/src/at.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-net-nrf91/src/at.rs')
-rw-r--r--embassy-net-nrf91/src/at.rs45
1 files changed, 45 insertions, 0 deletions
diff --git a/embassy-net-nrf91/src/at.rs b/embassy-net-nrf91/src/at.rs
new file mode 100644
index 000000000..04cbf3876
--- /dev/null
+++ b/embassy-net-nrf91/src/at.rs
@@ -0,0 +1,45 @@
1use crate::{Error, Control};
2
3// Drives the control loop of the modem based on declarative configuration.
4pub struct AtDriver<'a> {
5 control: Control<'a>,
6 config: Config,
7}
8
9pub struct Config {
10 pub network: NetworkConfig,
11}
12
13pub struct NetworkConfig {
14 pub apn: &'static str,
15 pub prot: AuthProtection,
16 pub userid: &'static str,
17 pub password: &'static str,
18}
19
20#[repr(u8)]
21pub enum AuthProtection {
22 None = 0,
23 Pap = 1,
24 Chap = 2,
25}
26
27impl<'a> AtDriver<'a> {
28 pub async fn new(control: Control<'a>, config: Config) -> Result<Self, Error> {
29 control.wait_init().await;
30 Ok(Self {
31 control,
32 config,
33 })
34 }
35
36 async fn setup(&self) -> Result<(), Error> {
37
38 }
39
40 pub fn run(&self, stack: Stack<crate::NetDriver<'static>>) -> ! {
41 loop {
42
43 }
44 }
45}