I'm currently writung a Win Iot app for the Raspberry Pi and I'm currently encountering some problems...
The problem I want to ask here is that I have multiple commands that I have to send out over the serial port (RS485) and I will also get a response in return. But whenever I accidently invoke the send command twice or somehow my app is doing nothing (it's doing something but I don't know what...sadly) and I press the send button again then my app crashes.
Now I want to ask if there is a method to get the current state of the serial port somehow? I wnat to know if the port is used for sending/recieving at the moment and if it is I want to block my command from being sent until the current operation is done. Or it should just give an error like "I'm busy. Try again later!".
I would really appreciate the help because I don't know how to do that :/