Sender: ej AT delorie DOT com Message-ID: <386BCF78.345D4724@tradeservices.com> Date: Thu, 30 Dec 1999 16:32:40 -0500 From: Eric Johnson X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.13-7mdksmp i686) X-Accept-Language: en MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: bcsio20 help Content-Type: multipart/mixed; boundary="------------2C5621E2ACC5C5373F914335" Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. --------------2C5621E2ACC5C5373F914335 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This message is intended for Bill Currie the author of BCSio20. If you could please forward this message, I would appreciate it. Hi Bill, I hope you're still supporting BCSio20. I'm stuck and was wondering if you could take a look at this code and let me know what I'm doing wrong. Attached is my source and the logfile that it writes. You will be able to tell what the input file is by reading the logfile. Basically, I have a label writer/psuedo printer that speaks a proprietary language called pywrite. I'm looking to have my C code read a set of pywrite commands and send them to the printer via COM1 on Windows 95. The code seems to execute without errors, but I'm not seeing the labels come out of the printer. When the printer reads a "showpage", a new label should emerge. I am using your included linker, and have even disabled COM1 under Win95 per your suggestion and still can't seem to get it to print. Note that in my source, I first tried using the sio_write function, but I kept getting a SIGSEGV, so I switched to sio_put which doesn't choke, but also doesn't work. FYI, I won't have access to my email for a week, so if you ask for more info, I'll get back to you as soon as I am able. TIA, Eric -- Eric Johnson - ej AT tradeservices DOT com || 603.766.2216 <---------> Quote of the minute <-----------> To restore a sense of reality, I think Walt Disney should have a Hardluckland. -- Jack Paar --------------2C5621E2ACC5C5373F914335 Content-Type: text/plain; charset=us-ascii; name="chlpr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="chlpr.c" #include #include #include #include #include "serio.h" #define MAX_READ 128 #define baud9600 96 #define COM1 0x3f8 #define COM2 0x2f8 #define C1IRQ 4 #define C2IRQ 3 int main(int argc, char **argv) { int i,written; char buf[MAX_READ],c; SioPort *comport; FILE *pyf; FILE *log; /* Required by BCSerio */ extern char sltext[] asm ("sltext"); extern char eltext[] asm ("eltext"); extern char sldata[] asm ("sldata"); extern char eldata[] asm ("eldata"); _go32_dpmi_lock_code(sltext,eltext-sltext); _go32_dpmi_lock_data(sldata,eldata-sldata); /* open log file for debugging */ log=fopen("c:/djgpp/bin/clog.txt","w"); if (!log) { fprintf(stderr, "could not open logfile: bailing!\n"); exit(1); } fprintf(log,"\nPanAm Helper App v3 Log File\n"); /* open pywrite commands */ pyf=fopen("c:/djgpp/bin/py.txt","r"); if (!pyf) { fprintf(log,"Could not open Pywrite command file: \n"); close(log); exit(1); } fprintf(log,"Attempting to open COM1\n"); /* open serial port using bcsio20 functions */ comport = sio_openport(COM1,C1IRQ); comport->sio_doxoff = 1; sio_setparms(comport, sio8Bits, sioNoParity, sio1StopBit); sio_setspeed(comport, baud9600); fprintf(log,"COM1 opened and comm parms set successfully\n"); fprintf(log,"Beginning to write Pywrite commands\n"); while (!feof(pyf)) { fgets(buf,MAX_READ,pyf); /* written=sio_write(comport,buf,sizeof(buf)); */ fprintf(log," <= "); for (i=0; i