- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- HPE 9000 and HPE e3000 Servers
- >
- Can't set modem control lines on the serial port /...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 12:58 PM
06-29-2016 12:58 PM
Can't set modem control lines on the serial port /dev/tty1p2 on an rp4440
Hi Folks,
I'm attempting to set the control lines on the /dev/tty1p2 port on an rp4440 with no luck.
The HP SE's told me it wasn't possible to activate the "remote" port on the rear of the rp4440 and that the "console" port was the only way to get any terminal or modem access. I got it to work quite easily by simply adding a line in the /etc/inittab file to start up a getty on /dev/tty1p2.
However, my real goal is to be able to set and get the status of the control lines, DTR, CTS, RTS, etc. My C program does allow me to open the tty using ioctl and allows me to set the control lines but when I get the status they are always zero.
My C program:
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
#include <sys/modem.h>
static int fd = 0;
int main() {
int state = 0;
char *tty = "/dev/tty1p2";
/* Open the serial port or die */
fd = open(tty, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd < 0)
{
fprintf(stderr, "ERROR: can not open \"%s\"\n", tty);
exit(2);
}
/* Set DTR on the port. */
ioctl(fd, TIOCMSET, TIOCM_DTR);
/* Get the status of the port. */
ioctl(fd, TIOCMGET, &state);
close(fd);
printf("Port -> %011x\n", state);
return (0);
When I run the program I always get the following output regardless of what I set:
./tty
Port -> 00000000000
I know the port is working as I put an HP terminal on it and I'm able to log in.
Yes! I have an HP terminal 700/96 that I still use on my servers in emergencies. ;o)
As always, thanks in advance for any insight, suggestions, recommendations, etc. ;o)
kev
- Tags:
- modem