开发者

How make sure modem is already connected to phone line

开发者 https://www.devze.com 2023-02-15 00:51 出处:网络
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 开发者

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号