Mxnportapi Function Groups; Example Program - Moxa Technologies CN2510-8 User Manual

Cn2510 series async server
Hide thumbs Also See for CN2510-8:
Table of Contents

Advertisement

CN2510
For more details about the installation, please refer to the Overview section.

MxNPortAPI Function Groups

The supported functions in this API are listed below:
Port Control
open
close
setIoctlMode
setFlowCtrl
setBaud
setRTS
setDTR
flush

Example Program

To make sure this API is workable with the device server on an Android platform, see the example program
below:
Thread thread = new Thread()
{
@Override
public void run() {
/* Enumerate and initialize NPorts on system */
List<MxNPort> NPortList = MxNPortService.getNPortInfoList();
if(NPortList!=null){
MxNPort.IoctlMode mode = new MxNPort.IoctlMode();
mode.baudRate = 38400;
mode.dataBits = MxNPort.DATA_BITS_8;
Input/Output
read
write
15-3
Android API Instructions
Port Status Inquiry
getBaud
getFlowCtrl
getIoctlMode
getLineStatus
getModemStatus
getOQueue
Miscellaneous
setBreak

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cn2510-16-48Cn2510-8-48Cn2510-16

Table of Contents