Borland C++ Serial function??

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
WilburNutsack
LCD?
Posts: 5
Joined: Tue Feb 05, 2002 4:00 pm

Post by WilburNutsack »

Hi
Has anyone got a function or could be bribed to write me one which checks com1 for any characters? I have wired up my keypad and checked it with hyper terminal. I also made a function with LabWindows CVI to determine the ASCII values, but i cant get it to work in Borland, so i am now back to square one.

I have a constant loop which check if there is a character waiting, if there is, i have a function to deal with it, then it continues decoding, if there is not, it just continues decoding the MP3.

e.g.
while (1)
{
var = checkSerial();// function needed
if (var != 0)
{
var == 1 do this...
var == 2 do other...
just handle input if there is any
}
if (Playing == 1)
{do {
status = decoder_play(decoder);
} while (status == XA_SUCCESS);
}
DisplayMenu();
DisplayCursor();
}

Any help would be greatly appreciated.
Feel free to contact me directly if you think you can help.
jiggyjiggylefteye@hotmail.com

Thanks
Mat-Moo
LCD Guru
Posts: 502
Joined: Wed Jan 16, 2002 4:00 pm
Contact:

Post by Mat-Moo »

Find a proper COM component to handle this, then it will raise an event when it recieves a character via RX
DJRobX
LCD?
Posts: 4
Joined: Sat Mar 30, 2002 4:00 pm

Post by DJRobX »

Or, you can try the Win32 serio libary from:

http://www.alumni.caltech.edu/~dank/serio/serio.zip

Might be a lot simpler than interfacing with COM. I know handling COM events is a serious pain in MFC, I'm not sure how easy or difficult it is with Borland.
Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

Henry J.
President
Matrix Orbital
Post Reply