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

Read request MTU neither exposed nor checked #46

Open
chrysn opened this issue Aug 3, 2022 · 0 comments
Open

Read request MTU neither exposed nor checked #46

chrysn opened this issue Aug 3, 2022 · 0 comments

Comments

@chrysn
Copy link
Contributor

chrysn commented Aug 3, 2022

When handling a ReadRequest, neither can the user see the the MTU, nor is it checked whether the value passed in is short enough:

while let Some(event) = rx.next().await {
    match event {
        Event::ReadRequest(read_request) => {
            read_request
                .response
                .send(Response::Success(something().to_vec()))
                .unwrap();
        }
    }
}

On the gatt-api side, the MTU is part of the ReadValue method as an option. I did not find the error behavior documented, but my observation is that responding with more bytes than the MTU indicates just leads to transmission of a truncated response, whereas I think good practice in Rust would be to indicate this through an error.

chrysn added a commit to chrysn-pull-requests/bluster that referenced this issue Aug 3, 2022
dfrankland pushed a commit that referenced this issue Mar 11, 2023
chrysn added a commit to chrysn-pull-requests/bluster that referenced this issue Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant