RS-232 Communication

Hello

I have Turbo c++ installed on Windows 3.1, i am working on RS-232 port communication. Below is the sample code i have written
#include <bios.h>
#include <conio.h>
#include <stdio.h>
#define COM1 0
#define DATA_READY 0x100
#define SETTINGS ( 0x80 | 0x02 | 0x00 | 0x00)
int main(void)
{
int in, out, status;
bioscom(0, SETTINGS, COM1); /*initialize the port*/
printf("Data sent to you: ");
while (1)
{
status = bioscom(3, 0, COM1); /*wait until get a data*/
if (status & DATA_READY)
if ((out = bioscom(2, 0, COM1) & 0x7F) != 0) /*input a data*/
putch(out);
if (kbhit())
{
if ((in = getch()) == 27) /* ASCII of Esc*/
break;
bioscom(1, in, COM1); /*output a data*/
}
}
return 0;
}

But problem with this is i am getting the below error:
Call to undefined function 'bioscom' in function main()

For Directories Setting i gave the path of \Include files which contains the BIOS.h but still i am getting the error. Please help me.
Not that I want to encourage anyone to practice writing with libraries that are old enough to drive in some countries but did you remember to link to libc.a? Otherwise bios.h isn't a standard header so it's kind of hard to diagnose this error.

If you have access to a newer platform then this is done with CreateFile and WriteFile these days.
Topic archived. No new replies allowed.