I have created a c++ app that needs to connect to a modem via a serial port in order to give AT commands. I’ve followed the following answer: how to open, read, and write from serial port in C and it works great. In some point of the code it is mentioned that the working thread should sleep for enough