I just noticed that if modem was not connected to phone line and you open SerialPort
and send an AT command like "AT\r\n"
Then your app hangs for about +20 seconds. How can i make sure that 开发者_如何学Pythonalready a phone line connected to modem?
You could only open and close the SerialPort
associated to device (modem for example). If it can't open it so it means it's not available.
you can use GetModemStatus to find the modem status.. if the modem is connected this function returns a specific value. i am not sure whether the value is same for every time.. in my pc this function returns 115.
精彩评论