Sponsored Content
Top Forums Programming Telling apart serial from // port Post 41095 by starless on Monday 29th of September 2003 02:01:13 PM
Old 09-29-2003
I meant "serial or parallel printer."
I took this approach to be the least intrusive in the client code. Replacing only 1 call (write) on the client side is better (to me)that replacing 3 calls(open, write, close). But I agree that writing a journal_open() and a journal_close() would allow to determine the kind of devices we're dealing with using the name. Then the journal_write() could take care of the details like paper-out/busy/alarm when appropriate.

I know that this isn't the best place to post QNX related problems, but it's for sure the best place for me to learn a bunch of UNIX related programming basics that are usefull in QNX. I'll try to keep it on the UNIX side!

Thank you for help and your well documented answer!
 

10 More Discussions You Might Find Interesting

1. Solaris

serial port signal

hi i am using solaris 9 on sparc . i was wondering if there was a command to control my serial interface , as to send a signal periodically every interval of time to the input of a 555 timer . thanks for your help .... (0 Replies)
Discussion started by: ppass
0 Replies

2. Solaris

Serial Port Datalogger

Hi, I'm using Solaris workstation with 5.4 OS. I was wondering if there's a way that I could log the data incoming and outgoing on a certain serial port. Thanks in Advance! (1 Reply)
Discussion started by: uryuu
1 Replies

3. Linux

urgent......Serial port

I think my serial port(on board) is not working ...... because when I am running same code on two machines its working good....but when my system comes into picture ....it doesnt show any output comming from serial port.......... can anybody tell me how to configure my serial port.........or to... (16 Replies)
Discussion started by: arunchaudhary19
16 Replies

4. Solaris

Serial port not found

Hi, I am working with solaris 9,SUN-Blade-100 and I want to communicate with the Serial port.To check whether the port is working or not.I write code and when I execute the file,then I got the output-- According to this,serial port is not found.can anyone please tell me how to configure the... (1 Reply)
Discussion started by: smartgupta
1 Replies

5. Programming

How to tell if a string to serial port has been sent

I have a need to determine when a string has been completely sent via a serial port from a standard 'C' application. The code is as follows: SerialPort_Send = open (pPortString, O_WRONLY | O_NOCTTY | O_NONBLOCK); write (SerialPort_Send, pCommandString, strlen (pCommandString)); ... (2 Replies)
Discussion started by: ExDes
2 Replies

6. AIX

Serial port in AIX

Hi, How can i configure my modem in AIX thru serial port (sa0-->tty0) I have two port serial card configured as sa0 I created tty1 which port is tty0 and which port is tty1 how can i know?? (1 Reply)
Discussion started by: pchangba
1 Replies

7. Shell Programming and Scripting

Need help with serial port

Hi, I have a external board connected to my serial port. I need to execute "shutdown -r now" command when system boot up. When system boots up it requires a username ans password. Then I need to run my command. I can use rc script but that is rebooting system before it asks for username and... (0 Replies)
Discussion started by: charlie.arya
0 Replies

8. Solaris

How to enable Serial port on ILOM, when Network Port is enabled in parallel

Hi Everyone, In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don't have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected... (3 Replies)
Discussion started by: bobby320
3 Replies

9. Web Development

Setup Serial Port

I need to set a serial port to 9600 7E1. How do I accomplish this? I've tried every combination, with no luck. (6 Replies)
Discussion started by: Meow613
6 Replies

10. Solaris

Cabling and adapters to communicate to service processor serial port from Windows PC with USB port.

Hello, I have an unloaded T5140 machine and want to access the ILOM for the first time and subsequently the network port after that., and then load Solaris 10 the final January 2011 build. The first part is what confuses me -the cabling. I am coming from a Windows machine (w/appropriate... (5 Replies)
Discussion started by: joboy
5 Replies
LP(4)							     Linux Programmer's Manual							     LP(4)

NAME
lp - line printer devices SYNOPSIS
#include <linux/lp.h> CONFIGURATION
lp[0-2] are character devices for the parallel line printers; they have major number 6 and minor number 0-2. The minor numbers correspond to the printer port base addresses 0x03bc, 0x0378 and 0x0278. Usually they have mode 220 and are owned by root and group lp. You can use printer ports either with polling or with interrupts. Interrupts are recommended when high traffic is expected, for example, for laser printers. For usual dot matrix printers polling will usually be enough. The default is polling. DESCRIPTION
The following ioctl(2) calls are supported: int ioctl(int fd, LPTIME, int arg) Sets the amount of time that the driver sleeps before rechecking the printer when the printer's buffer appears to be filled to arg. If you have a fast printer, decrease this number; if you have a slow printer then increase it. This is in hundredths of a second, the default 2 being 0.02 seconds. It only influences the polling driver. int ioctl(int fd, LPCHAR, int arg) Sets the maximum number of busy-wait iterations which the polling driver does while waiting for the printer to get ready for receiv- ing a character to arg. If printing is too slow, increase this number; if the system gets too slow, decrease this number. The default is 1000. It only influences the polling driver. int ioctl(int fd, LPABORT, int arg) If arg is 0, the printer driver will retry on errors, otherwise it will abort. The default is 0. int ioctl(int fd, LPABORTOPEN, int arg) If arg is 0, open(2) will be aborted on error, otherwise error will be ignored. The default is to ignore it. int ioctl(int fd, LPCAREFUL, int arg) If arg is 0, then the out-of-paper, offline and error signals are required to be false on all writes, otherwise they are ignored. The default is to ignore them. int ioctl(int fd, LPWAIT, int arg) Sets the number of busy waiting iterations to wait before strobing the printer to accept a just-written character, and the number of iterations to wait before turning the strobe off again, to arg. The specification says this time should be 0.5 microseconds, but experience has shown the delay caused by the code is already enough. For that reason, the default value is 0. This is used for both the polling and the interrupt driver. int ioctl(int fd, LPSETIRQ, int arg) This ioctl(2) requires superuser privileges. It takes an int containing the new IRQ as argument. As a side effect, the printer will be reset. When arg is 0, the polling driver will be used, which is also default. int ioctl(int fd, LPGETIRQ, int *arg) Stores the currently used IRQ in arg. int ioctl(int fd, LPGETSTATUS, int *arg) Stores the value of the status port in arg. The bits have the following meaning: LP_PBUSY inverted busy input, active high LP_PACK unchanged acknowledge input, active low LP_POUTPA unchanged out-of-paper input, active high LP_PSELECD unchanged selected input, active high LP_PERRORP unchanged error input, active low Refer to your printer manual for the meaning of the signals. Note that undocumented bits may also be set, depending on your printer. int ioctl(int fd, LPRESET) Resets the printer. No argument is used. FILES
/dev/lp* SEE ALSO
chmod(1), chown(1), mknod(1), lpcntl(8), tunelp(8) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 1995-01-15 LP(4)
All times are GMT -4. The time now is 02:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy