Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Buffers type #193

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -1,10 +1,10 @@
#![feature(async_fn_in_trait)]

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

View workflow job for this annotation

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

the feature `async_fn_in_trait` has been stable since 1.75.0 and no longer requires an attribute to enable

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

View workflow job for this annotation

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

the feature `async_fn_in_trait` has been stable since 1.75.0 and no longer requires an attribute to enable

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

View workflow job for this annotation

GitHub Actions / Test

the feature `async_fn_in_trait` has been stable since 1.75.0 and no longer requires an attribute to enable
#![allow(incomplete_features)]
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 @@
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
Loading