Board index » delphi » Ho to check modem activity

Ho to check modem activity

How can I check if the modem is active or not?

Does anyone knows the answer to this problem or does any has a source code
(or website were I can find one) to handle this?

Thanks!

 

Re:Ho to check modem activity


Quote
Jeffrey Drooghenbroodt wrote in message

<78e6a7$gd...@news3.Belgium.EU.net>...

Quote
>How can I check if the modem is active or not?

>Does anyone knows the answer to this problem or does any has a source code
>(or website were I can find one) to handle this?

>Thanks!

Okay I've mentioned this method before but it is quite low level but if all
you want to do is see if there is data going across the serial port - if
thats what you mean by 'active'?

just look at the memory address assigned to the modem eg serial port 2 is
memory address 02f8.  If you monitor this address and the value of the data
changes constantly then then data is going accross the interface.

If you want to find out if the modem is ready etc  then just send the usual
hayes commands into that memory address
eg
    sending 'AT' to that memory address should get you a response of 'OK'
Glen

Re:Ho to check modem activity


Glen Kleidon heeft geschreven in bericht
<917157065.2...@terra.ultra.net.au>...

Quote
|Jeffrey Drooghenbroodt wrote in message

|<78e6a7$gd...@news3.Belgium.EU.net>...
|>How can I check if the modem is active or not?
|>
|>Does anyone knows the answer to this problem or does any has a source
code
|>(or website were I can find one) to handle this?
|>
|>
|>Thanks!
|>
|
|

[snip]

|just look at the memory address assigned to the modem eg serial port 2 is
|memory address 02f8.  If you monitor this address and the value of the
data
|changes constantly then then data is going accross the interface.
|

Glen:
Sorry, but I have to disagree. I think this is a _very_ bad method.

-First, you'll only get away with it under W95/98. NT will kill any app
that tries to approach hardware addresses directly.
-Second, every character _you_ read from the port, is snatched away from
the device driver, which can (will) mess up ongoing communications.
-Third, the method won't give deterministic results. You may be able to
detect that there is some activity on the port. Detecting no activity
however, does not guarantee that the modem is not in use. Remember that WWW
stands for World Wide Wait....<g>

The "right" way to check whether or not a modem/port is in use, is simply
trying to open it. ( See CreateFile('COM2',<many, many parameters <g>> )
in WIN32-Help.
If you get back ERROR_INVALID_HANDLE, then he port is in use by another app
or the system.

Regards,
Dirk Claessens
______________________________________________
dirk.claess...@village.ZZuunet.be
dirk.claessens...@belgium.ZZagfa.com
Mailheader was forged  to fight spam !
Use the above and remove ZZ
______________________________________________

Re:Ho to check modem activity


Bedankt, Dirk

Dirk Claessens heeft geschreven in bericht <78fh74$an...@xenon.inbe.net>...

Quote
>Glen Kleidon heeft geschreven in bericht
><917157065.2...@terra.ultra.net.au>...

>|Jeffrey Drooghenbroodt wrote in message
>|<78e6a7$gd...@news3.Belgium.EU.net>...
>|>How can I check if the modem is active or not?
>|>
>|>Does anyone knows the answer to this problem or does any has a source
>code
>|>(or website were I can find one) to handle this?
>|>
>|>
>|>Thanks!
>|>
>|
>|

>[snip]

>|just look at the memory address assigned to the modem eg serial port 2 is
>|memory address 02f8.  If you monitor this address and the value of the
>data
>|changes constantly then then data is going accross the interface.
>|

>Glen:
>Sorry, but I have to disagree. I think this is a _very_ bad method.

>-First, you'll only get away with it under W95/98. NT will kill any app
>that tries to approach hardware addresses directly.
>-Second, every character _you_ read from the port, is snatched away from
>the device driver, which can (will) mess up ongoing communications.
>-Third, the method won't give deterministic results. You may be able to
>detect that there is some activity on the port. Detecting no activity
>however, does not guarantee that the modem is not in use. Remember that WWW
>stands for World Wide Wait....<g>

>The "right" way to check whether or not a modem/port is in use, is simply
>trying to open it. ( See CreateFile('COM2',<many, many parameters <g>> )
>in WIN32-Help.
>If you get back ERROR_INVALID_HANDLE, then he port is in use by another app
>or the system.

>Regards,
>Dirk Claessens
>______________________________________________
>dirk.claess...@village.ZZuunet.be
>dirk.claessens...@belgium.ZZagfa.com
>Mailheader was forged  to fight spam !
>Use the above and remove ZZ
>______________________________________________

Other Threads