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

Refactor/(generic bufsize) #50

Merged
merged 23 commits into from
Jun 11, 2020
Merged

Refactor/(generic bufsize) #50

merged 23 commits into from
Jun 11, 2020

Conversation

MathiasKoch
Copy link
Member

This PR allows creating ATAT instances with generic receive buffer size.

Building the Client/IngressManager pair through ClientBuilder will keep the default buffer length of U256, but it allows specifying lengths if crated "manually" as

let (res_p, res_c) = unsafe { RES_QUEUE.split() };
let (urc_p, urc_c) = unsafe { URC_QUEUE.split() };
let (com_p, com_c) = unsafe { COM_QUEUE.split() };

let at_config = Config::new(Mode::Timeout);
let mut ingress: IngressManager<consts::U512, NoopUrcMatcher> = IngressManager::with_custom_urc_matcher(
    res_p,
    urc_p,
    com_c,
    at_config,
    None,
);
let client: Client<Tx<UART4>, Timer, consts::U512> = Client::new(tx, res_c, urc_c, com_p, cell_at_timer, at_config);

Note This is still a bit of a work-in-progress, as i am not super happy with the API breaking it brings, though i don't think there are better ways?

It will address the part of #43 regarding IngressManager - buf capacity

Any better ideas will be welcomed with great joy!

@MathiasKoch MathiasKoch added the atat Issues related to the atat crate of the workspace label May 5, 2020
@MathiasKoch MathiasKoch requested a review from dbrgn May 5, 2020 07:56
@MathiasKoch MathiasKoch self-assigned this May 5, 2020
@MathiasKoch
Copy link
Member Author

Updated the PR to actually fix #43 , while also introducing a driver! macro, to replace the previous ClientBuilder.. This also solves part of the issue of instantiating multiple clients.. We still need a way of building unique identifiers for the static queues in the macro.. Maybe the only way is to introduce driver! as a proc_macro.

@MathiasKoch MathiasKoch linked an issue May 7, 2020 that may be closed by this pull request
4 tasks
This was referenced May 29, 2020
@MathiasKoch MathiasKoch merged commit 479175c into master Jun 11, 2020
@MathiasKoch MathiasKoch deleted the refactor/generic-bufsize branch July 9, 2020 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
atat Issues related to the atat crate of the workspace
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make buffer length and queue lengths generic
1 participant