aboutsummaryrefslogtreecommitdiff
path: root/embassy-net-nrf91
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2024-08-05 12:09:58 +0200
committerUlf Lilleengen <[email protected]>2024-08-21 12:44:07 +0200
commit86a45b47e529864ac5a203b4ad26b9ee62127a1e (patch)
tree24cee48d3295329a1709fe131639da8204285c69 /embassy-net-nrf91
parentbc67cc22aa1461e6bce19b663b00bdccc818a998 (diff)
add at command file
Diffstat (limited to 'embassy-net-nrf91')
-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}