Portbase User Guide
char
readbuff[255];
// Reads data.
readval = read(porthandle, readbuff, sizeof(readbuff));
if (readval < 1) return;
readbuff[readval] = 0;
printf("%s",readbuff);
}
//Opens the ttys0 port of RTCP connected to Portbase.
void OpenSerial(void)
{
int
i;
// Opens the ttys0 port.
porthandle = open(“/dev/ttys0”, O_RDWR | O_NOCTTY |O_NONBLOCK);
// Outputs an error if the socket port is not valid.
if (porthandle < 0){
printf("Can not Open %s\n", ComName);
}
}
107