Serial Communications

Overview

This section describes types and facilities used when programming serial communicatins. More…

import "io_base.jncx"
import "io_Serial.jnc"

// enums

bitflag enum io.SerialEvents;
enum io.SerialFlowControl;
bitflag enum io.SerialLineErrors;
bitflag enum io.SerialOptions;
enum io.SerialParity;
bitflag enum io.SerialPortDescFlags;
bitflag enum io.SerialStatusLines;
enum io.SerialStopBits;

// structs

struct io.SerialPortDesc;

// classes

class io.Serial;

// global functions

io.SerialPortDesc const* io.enumerateSerialPorts(
    io.SerialPortDescFlags flags,
    size_t* count = null
);

io.SerialPortDesc const* io.enumerateSerialPorts(size_t* count = null);

Detailed Documentation

This section describes types and facilities used when programming serial communicatins.

Global Functions

io.SerialPortDesc const* io.enumerateSerialPorts(
    io.SerialPortDescFlags flags,
    size_t* count = null
)

io.SerialPortDesc const* io.enumerateSerialPorts(size_t* count = null)

Enumerates all available serial ports.

count argument can be used to obtain the total number of devices in the resulting list.

Returns a pointer to the very first io.SerialPortDesc in the resulting list. You can walk through the list by inspecting io.SerialPortDesc.m_next field:

io.SerialPortDesc const* portDesc = io.enumerateSerialPorts();
for (; portDesc; portDesc = portDesc.m_next) {
    // add port to the combo box...
}