This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART callback to return received value to initiating function?

I'm trying to communicate with a device over UART, and I'd like to return the response to my commands back to the function the transmission came from.

For example, I want to transmit a simple "AT" over UART and expect to receive the response "OK", but I'd like to check that response within the same function I send the command from, ideally without polling.

Right now my UART callback handler is in main.c, and the functions that send the commands are in another c file, which may or may not have an impact on how this should be done...

So is there any good way to go about this?

Related