PDA

View Full Version : _bios_serialcom HELP!!!



NoIdea
10-03-2002, 08:07 PM
Using _bios_serialcom how would i send a command (eg. "LTD\r") in one go?

I've tried putc, putch but so far can only achieve it in the most repeatetive way

_bios_serialcom(_COM_SEND, COM2, 'L');
_bios_serialcom(_COM_SEND, COM2, 'T');
_bios_serialcom(_COM_SEND, COM2, 'D');
_bios_serialcom(_COM_SEND, COM2, '\r');

which is obviously a waste of time & code.


TIA!!!!

Noidea
10-03-2002, 08:08 PM
BTW, i'm using Borland Turbo C++ 3.0 DOS

Hillbillie
10-03-2002, 08:50 PM
Write a function that sends a string. Hint: Use a loop. Another hint: You _may_ have to pause a short amount of time between each write, depending on how fast your computer is and how fast your serial port can send.

Someidea
10-03-2002, 09:09 PM
i just found that the following works perfectly.

for(i=0; cmd[i]; i++)
_bios_serialcom(_COM_SEND, COM2, cmd[i]);