Howto program ecpp0 correctly?

Howto program ecpp0 correctly?

Post by Michael Halad » Fri, 20 Oct 2000 04:00:00



Hi
can anybody provide me a piece of sample c code on how to program correctly
the /dev/ecpp0 port.
That means: read the port state(Printer ready, busy, paperout...), write to
the port, ...

I have problems on a Ultra10 running Solaris 2.6 5/98

I applied the patch 105741-05 (105741-07 seems not to work) to eliminate the
following errors:
1) ecpp_isr: interrupt not for us
2) interrupt level 3 not serviced

So these two errors are eliminated.
sometimes when I try to open the port /dev/ecpp0, I get the Error Device
Busy, but nobody (no process) is using it!!

Further, if I write a bigger part of graphics Data to the printer (port),
several datas are lost during transmission. Guess cause the Handshake is not
working correctly.??

What is the difference of ECPPIOC_TESTIO ioctl( ) and BPPIOC_TESTIO ?
Compilation and run is possible wether i include <sys/ecppio.h> or
<sys/bpp_io.h> !

So, if anybody has a sample code please send it to me!

Finally, i have to write the application to run on SPARC(SBus and PCI) and
Intel !
Thanks for any hints andd tips and codes...
Michael Halada

 
 
 

1. Howto capture output from external program run from C program

I seem to be doing what a lot of others are wanting, to capture a list
of process id's and store them in some buffer. I can't work out how to
do this, but feel I'm very close, especially after reading other
people's posts. Excuse the following if it's vegi programming for
some... :)

I have the following is a C program:

        strcpy(processBuffer, "/bin/ps ");
        strcat(processBuffer, pid[temp2]);
        printf("%s\n", processBuffer);

        process_output = popen(processBuffer, "r");
        fread(fetchBuffer, 1, 30, process_output);
        pclose(process_output);
        if(!strcmp(fetchBuffer, "No processes available"))
        {
                printf("Process not found\n");
        }

The pid[temp2] is a char type containing the pid, eg. "537". What
happens at this point in the code is that when the popen function is
called, the output is sent to the terminal screen, rather than to
process_output. So, how do I STOP it from printing to screen and
capturing it to a buffer or string?

If the answer is "don't use popen, could you please provide a very
simple example, or parts of one?

Any help would be greatly appreciated. Cheers.
Mike Berry-Porter

2. boot problem?

3. pthread: How to exit (correctly shutdown a program) from a child thread?

4. Can't compile kernel.....

5. Program won't work correctly with 2.5!

6. What should be the total disk space required by SUNWall cluster in solaris 8

7. Closing programs correctly

8. gimp compile error

9. Program not terminated correctly: now kill -9 won't work on them.

10. Linux C compiler doesn't make programs correctly

11. Sun Ultra Parallel Port /dev/ecpp0

12. Has anyone gotten a printer to work on /dev/ecpp0 (ultra-10).

13. Possible problem with printing via ecpp0?