There’s a way, but you have to create it. It’s a basic Serial communication. Very straight forward: send and receive data. There are no checks if the data was correctly sent etc. So, when I need precision, I create a protocol, like HTTP and others, that expect data in a specific format and, if it’s not that way, requests again or wait for the next package.