Check pin state of Serial Port

I

I'mLost

Hi! I need to create a simple program to check and monitor the state
of the pins on a serial interface on a ups. I want to be able to tell
what pins are in what state and when but I don't know where to start.
Can anyone help me!
I have searched all over, including google code (which is hard if you
don't already know what you are looking for, but I can't find anything
that will help me to get started. It seems really simple. I have a
Linux computer and a ups, with a serial cable connecting them. I want
to "see" which pins change their state when the power goes out and
when the battery gets low. The plan is to use this to trigger other
events that have NOTHING TO DO WITH SHUTTING THE PC DOWN.

If anyone has any kind of advise that I might be able use, then please
give it to me.
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

Hi! I need to create a simple program to check and monitor the state
of the pins on a serial interface on a ups. I want to be able to tell
what pins are in what state and when but I don't know where to start.
Can anyone help me!
I have searched all over, including google code (which is hard if you
don't already know what you are looking for, but I can't find anything
that will help me to get started. It seems really simple. I have a
Linux computer and a ups, with a serial cable connecting them. I want
to "see" which pins change their state when the power goes out and
when the battery gets low. The plan is to use this to trigger other
events that have NOTHING TO DO WITH SHUTTING THE PC DOWN.

If anyone has any kind of advise that I might be able use, then please
give it to me.

This have nothing to do with C++, try a group discussing Linux instead.
A hint, perhaps check if you have something in /dev for that serial
interface.
 
I

I'mLost

This have nothing to do with C++, try a group discussing Linux instead.
A hint, perhaps check if you have something in /dev for that serial
interface.

its not it! what I want is to write my own program to pickup on the
state of each pin on the serial interface. How would I go about
finding information about how to, or help, coding this.
 
M

Miguel Gimenez

I'mLost said:
its not it! what I want is to write my own program to pickup on the
state of each pin on the serial interface. How would I go about
finding information about how to, or help, coding this.

Google for ioctl and (for example) TIOCMGET
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

its not it! what I want is to write my own program to pickup on the
state of each pin on the serial interface. How would I go about
finding information about how to, or help, coding this.

Please don't quote signatures.

What I meant was that how to read the pins is off topic in this group,
here we discuss the C++ language as defined by the standard. The
standard does not say anything about signals from serial ports or about
reading pins. These are implementation dependent topics (how you do it
varies between different OSes and so on) and should thus be discussed in
a group for discussing your OS.

If you find something suitable under /dev we can discuss how to open it
as a file and read data from it, since the standard specifies that. We
can not, however, discuss how to interpret the data.
 
B

Bart van Ingen Schenau

I'mLost said:
its not it! what I want is to write my own program to pickup on the
state of each pin on the serial interface. How would I go about
finding information about how to, or help, coding this.

I am sorry, but we can't help you here.
Standard C++ (our topic) does not define any hardware interfaces.
To find out how to access the hardware pins of a serial interface, you
will have to ask in a group dedicated to your OS.
As such low-level hardware access is usually not granted to user
applications, you probably will have to write a device driver.

Bart v Ingen Schenau
 
I

I'mLost

I am sorry, but we can't help you here.
Standard C++ (our topic) does not define any hardware interfaces.
To find out how to access the hardware pins of a serial interface, you
will have to ask in a group dedicated to your OS.
As such low-level hardware access is usually not granted to user
applications, you probably will have to write a device driver.

Bart v Ingen Schenau

Ok. Thanks.
Sorry for the bother
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top