-
Notifications
You must be signed in to change notification settings - Fork 7.3k
bluetooth: samples: mtu_update: peripheral: Add NULL check #88889
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
bluetooth: samples: mtu_update: peripheral: Add NULL check #88889
Conversation
Add NULL check for connection context, and only send the notification if connection is established. Signed-off-by: Sayooj K Karun <[email protected]>
Hello @sayooj-atmosic, and thank you very much for your first pull request to the Zephyr project! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine, although the sample seems pretty naively implemented. It could be further improved by using e.g. a semaphore to not do any looping until it's actually connected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change is OK, although I think it makes more sense to not print anything when not connected
Hi @sayooj-atmosic! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
Add NULL check for connection context, and only send the notification if connection is established.