NNTP-Posting-Host: delorie.com Newsgroups: comp.os.msdos.djgpp From: Eric Johnson Subject: bcsio20 help Message-ID: <4854D13580C5D211AD190008C73393D086E93D@tgxch01.taylornet.com> Supersedes: <4854D13580C5D211AD190008C73393D086B3FB AT tgxch01 DOT taylornet DOT com> Date: Thu, 30 Dec 1999 16:32:40 -0500 MIME-Version: 1.0 Lines: 233 X-Newsreader: Microsoft (R) Exchange Internet News Service Version 5.5.2448.0 Organization: None provided Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01BF536E.89E9459C" To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01BF536E.89E9459C Content-Type: text/plain; charset="windows-1252" 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 ------_=_NextPart_000_01BF536E.89E9459C Content-Type: text/plain; name="chlpr.c" Content-Disposition: attachment; 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