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

Handling and propagation of UART errors #4

Open
wants to merge 4 commits into
base: gsdk_4.0
Choose a base branch
from

Conversation

bojanpotocnik
Copy link

@bojanpotocnik bojanpotocnik commented Feb 10, 2022

UART callback functions (except TX) already returned status codes, but they were never checked, resulting in blocking states in case of UART errors.
This PR adds return code to UART TX function and actually handles return codes of all UART callbacks, and optional time callback to prevent infinite blocking in case there is no UART I/O error, but the application error.

Add return code to UART TX function to be able to detect transmit
errors and propagate this information to higher layers.
UART RX callback functions return status codes, but they were never
checked in the library code. Handle failures of UART RC callbacks
and propagate them to higher layers.
This prevents infinite blocking when BT chip is not present or is not
responding to the commands. Usually, functions check for pending data
using UART peek callback first, but in some cases data is just awaited
(sl_bt_wait_response, sli_bgapi_get_event), causing infinite blocking
when BT chip is not present or not responding.
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

Successfully merging this pull request may close these issues.

1 participant