Hi, first of all I wanted to thank you for trying to help me. Secondly, sorry for my bad English.
I will explain everything. I made a machine and who controls this machine is an esp3 with grbl. I connect to esp32 via bluetooth and send a command and it responds with an OK when it has finished executing the command.
But I can only send commands if the connection is active and I don't know how to know if it's active because the serial class doesn't return the status of the connection. It could also be that I didn't understand how a serial connection works, I'm starting now with this subject.
If you can explain to me or send me an example of something that shows how this connection dynamic works, I would be very grateful.
Thank you very much
Fernando