Skip to content

Android: GATT read/write failures are reported as success #492

Description

@qdot

src/droidplug/java/.../Peripheral.java onCharacteristicRead, onCharacteristicWrite, onDescriptorRead, onDescriptorWrite command callbacks never check status.

Failure scenario: write() to a characteristic requiring encryption gets GATT_INSUFFICIENT_AUTHENTICATION and returns Ok(()); a failed read() returns stale/empty bytes as Ok. Violates the Peripheral::write contract ("error ... if the device returns an error").

Fix direction: fail the future when status != GATT_SUCCESS, including the status code in the error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidIssues related to the android corebugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions