PutCom2

Availability All terminals
Description PutCom2() transmits a character through the specified serial communications port.
Syntax int PutCom2( int port, unsigned char c );
Arguments
unsigned char c
Character or byte that is to be transmitted
int port
port specifies which serial communications port is to be opened. See the table below for details.

Terminal Supported ports Description
OPN-2500 & OPN-6000 COM0
COM1
COM7
COM8
COM9
COM10
COM11
COM12
COM13
COM14
COM15
COM16
COM17
COM18
USB-VCP (Opticon 1D COM-Port)
USB-CDC (Opticon 2D COM-Port)
USB-CDC (OptiConnect)
USB-CDC (Opticon 2D COM-Port)
USB-HID (Human Interface device)
USB-MSD (Mass Storage)
Bluetooth HID (No white list)
Bluetooth HID (White list)
Bluetooth LE UART & OptiConnect (No white list)
Bluetooth LE UART & OptiConnect (White list)
Bluetooth LE OptiConnect(No white list)
Bluetooth LE OptiConnect (White list)
Bluetooth LE UART (No white list)
Bluetooth LE UART (White list)
int c
c is the character that is to be transmitted.
Returns OK or ERROR.
Remarks When the COM port was not opened previously, ERROR will be returned.
Example
#include <stdio.h>
#include "lib.h"

void main( void )
{
    int ch;

    ComOpen( COM9 );    // Open the COM port for USB-VCP

    for(;;)
    {
        if( (ch = GetCom2( COM9, 0 )) != -1)
        {
            PutCom2( COM9, ch );
        }
        Idle();    // Very important to lower the power consumption
    }
}