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

Can't figure out how to dynamically set read value on a characteristic based on central UUID #32

Open
jturner-flow opened this issue May 1, 2024 · 0 comments

Comments

@jturner-flow
Copy link

I'm trying to implement a peripheral on a Pi that looks at the central's UUID on a willRead and figures out the reply based on some business logic. The problem is that because peripheral.write is async, there doesn't appear to be a way to dynamically change the value on a willRead in time for the response to go out.

Is there a recommended pattern to follow for this:

private func willRead(_ request: GATTReadRequest<Central>) -> ATTError? {
        logger.info("Recevied read")
        guard let peripheral else {
            return nil
        }
       /// SET THE VALUE OF THE CHARACTERISTIC
}
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