Skip to content

Commit

Permalink
Remove Buffers type
Browse files Browse the repository at this point in the history
  • Loading branch information
rmja committed Dec 11, 2023
1 parent 23d9c18 commit 829d4e2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 94 deletions.
78 changes: 0 additions & 78 deletions atat/src/buffers.rs

This file was deleted.

2 changes: 0 additions & 2 deletions atat/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@
// This mod MUST go first, so that the others see its macros.
pub(crate) mod fmt;

mod buffers;
mod config;
pub mod digest;
mod error;
Expand Down Expand Up @@ -261,7 +260,6 @@ pub use serde_at;
#[cfg(feature = "derive")]
pub use heapless;

pub use buffers::Buffers;
pub use config::Config;
pub use digest::{AtDigester, AtDigester as DefaultDigester, DigestResult, Digester, Parser};
pub use error::{CmeError, CmsError, ConnectionError, Error, InternalError};
Expand Down
17 changes: 10 additions & 7 deletions examples/src/bin/embassy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
#![feature(type_alias_impl_trait)]
#![allow(incomplete_features)]

use atat::{asynch::AtatClient, AtatIngress, Buffers, DefaultDigester, Ingress};
use atat::{
asynch::{AtatClient, Client},
AtatIngress, DefaultDigester, Ingress, ResponseChannel, UrcChannel,
};
use atat_examples::common;
use embassy_executor::Spawner;
use embassy_executor::_export::StaticCell;
Expand Down Expand Up @@ -47,14 +50,14 @@ async fn main(spawner: Spawner) {
);
let (reader, writer) = uart.split();

static BUFFERS: Buffers<common::Urc, INGRESS_BUF_SIZE, URC_CAPACITY, URC_SUBSCRIBERS> =
Buffers::<common::Urc, INGRESS_BUF_SIZE, URC_CAPACITY, URC_SUBSCRIBERS>::new();

let (ingress, mut client) = BUFFERS.split(
writer,
static RES_CHANNEL: ResponseChannel<INGRESS_BUF_SIZE> = ResponseChannel::new();
static URC_CHANNEL: UrcChannel<Urc, URC_CAPACITY, URC_SUBSCRIBERS> = UrcChannel::new();
let ingress = Ingress::new(
DefaultDigester::<common::Urc>::default(),
atat::Config::default(),
RES_CHANNEL.publisher(),
URC_CHANNEL.publisher(),
);
let mut client = Client::new(writer, RES_CHANNEL.subscriber(), atat::Config::default());

spawner.spawn(ingress_task(ingress, reader)).unwrap();

Expand Down
18 changes: 11 additions & 7 deletions examples/src/bin/std-tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use atat_examples::common;

use std::process::exit;

use atat::{asynch::AtatClient, AtatIngress, Buffers, Config, DefaultDigester, Ingress};
use atat::{asynch::AtatClient, AtatIngress, Config, DefaultDigester, Ingress};

Check warning on line 7 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive)

unused import: `Config`

Check warning on line 7 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive, log)

unused import: `Config`

Check warning on line 7 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Test

unused import: `Config`
use embedded_io_adapters::tokio_1::FromTokio;
use tokio_serial::SerialStream;

Expand All @@ -16,15 +16,19 @@ const URC_SUBSCRIBERS: usize = 3;
async fn main() -> ! {
env_logger::init();

static BUFFERS: Buffers<common::Urc, INGRESS_BUF_SIZE, URC_CAPACITY, URC_SUBSCRIBERS> =
Buffers::<common::Urc, INGRESS_BUF_SIZE, URC_CAPACITY, URC_SUBSCRIBERS>::new();

let (reader, writer) = SerialStream::pair().expect("Failed to create serial pair");

let (ingress, mut client) = BUFFERS.split(
FromTokio::new(writer),
static RES_CHANNEL: ResponseChannel<INGRESS_BUF_SIZE> = ResponseChannel::new();

Check failure on line 21 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive)

cannot find type `ResponseChannel` in this scope

Check failure on line 21 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive)

failed to resolve: use of undeclared type `ResponseChannel`

Check failure on line 21 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive, log)

cannot find type `ResponseChannel` in this scope

Check failure on line 21 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive, log)

failed to resolve: use of undeclared type `ResponseChannel`

Check failure on line 21 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Test

cannot find type `ResponseChannel` in this scope

Check failure on line 21 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Test

failed to resolve: use of undeclared type `ResponseChannel`
static URC_CHANNEL: UrcChannel<Urc, URC_CAPACITY, URC_SUBSCRIBERS> = UrcChannel::new();

Check failure on line 22 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive)

cannot find type `UrcChannel` in this scope

Check failure on line 22 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive)

cannot find type `Urc` in this scope

Check failure on line 22 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive)

failed to resolve: use of undeclared type `UrcChannel`

Check failure on line 22 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive, log)

cannot find type `UrcChannel` in this scope

Check failure on line 22 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive, log)

cannot find type `Urc` in this scope

Check failure on line 22 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive, log)

failed to resolve: use of undeclared type `UrcChannel`

Check failure on line 22 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Test

cannot find type `UrcChannel` in this scope

Check failure on line 22 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Test

cannot find type `Urc` in this scope

Check failure on line 22 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Test

failed to resolve: use of undeclared type `UrcChannel`
let ingress = Ingress::new(
DefaultDigester::<common::Urc>::default(),
Config::default(),
RES_CHANNEL.publisher(),
URC_CHANNEL.publisher(),
);
let mut client = Client::new(

Check failure on line 28 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive)

failed to resolve: use of undeclared type `Client`

Check failure on line 28 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Build (x86_64-unknown-linux-gnu, derive, log)

failed to resolve: use of undeclared type `Client`

Check failure on line 28 in examples/src/bin/std-tokio.rs

View workflow job for this annotation

GitHub Actions / Test

failed to resolve: use of undeclared type `Client`
FromTokio::new(writer),
RES_CHANNEL.subscriber(),
atat::Config::default(),
);

tokio::spawn(ingress_task(ingress, FromTokio::new(reader)));
Expand Down

0 comments on commit 829d4e2

Please sign in to comment.