![SystemBase Portbase-3010 Скачать руководство пользователя страница 105](http://html.mh-extra.com/html/systembase/portbase-3010/portbase-3010_user-manual_1423462105.webp)
Portbase User Guide
2.
TTY Port Communication Program
TTYxx port communication is most generally used serial communication method under the Linux/Unix
environment.
1) Function Description
open() -------------- Open a communication port.
|
read(), write() --- Read or write data from the open communication port.
|
close() ------------- Close the open communication port.
2) Result
Application repeatedly transmits “This is LoopBack Data!” through the ttyS0 port at 3 second
intervals and displays data from ttyS0 on screen.
3) How to Run
Plug the loopback connector to the first serial port of Portbase.
Run Redirector and select Portbase to register the first serial port as ttyS0.
If you run the program, the following screen appears and “This is LoopBack Data!“ is repeatedly
displayed on the edit box at 3 sec. Intervals.
4) Source Code
//Inserts the necessary header files.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/un.h>
#include <string.h>
int porthandle; // Handle for the socket of RTCP
int readval; // Variable for saving the returned value of read
void OpenSerial(void);
105
Содержание Portbase-3010
Страница 1: ......
Страница 61: ...Portbase User Guide 4 Click Next 5 Choose destination location and click Next 61 ...
Страница 90: ...Portbase User Guide Log Window 90 ...