Skip to content

Read request MTU neither exposed nor checked #46

@chrysn

Description

@chrysn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions