SerialPort

Timed work with serial port

Constructors

this
this(string exmode)
this(string port, string mode)
this(string port, uint baudRate)
this(string port, uint baudRate, string mode)
this(string port, Config conf)

Construct SerialPort

Members

Enums

CanRead
enum CanRead

Functions

checkAbility
void checkAbility(CanRead cr, size_t readed, size_t buffer)
flush
void flush()

Read data from serial port while exists

read
void[] read(void[] buf, CanRead cr)

Read data from port

updateTimeouts
void updateTimeouts()
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(const(void[]) buf)

Write data to port

Properties

readTimeout
Duration readTimeout [@property getter]
readTimeout
Duration readTimeout [@property setter]
readTimeoutMult
Duration readTimeoutMult [@property getter]
readTimeoutMult
Duration readTimeoutMult [@property setter]
writeTimeout
Duration writeTimeout [@property getter]
writeTimeout
Duration writeTimeout [@property setter]
writeTimeoutMult
Duration writeTimeoutMult [@property getter]
writeTimeoutMult
Duration writeTimeoutMult [@property setter]

Variables

_readTimeout
Duration _readTimeout;
_readTimeoutMult
Duration _readTimeoutMult;
Undocumented in source.
_writeTimeout
Duration _writeTimeout;
_writeTimeoutMult
Duration _writeTimeoutMult;
Undocumented in source.

Inherited Members

From SerialPortBase

port
string port;
_handle
SPHandle _handle;
Undocumented in source.
Config
alias Config = SPConfig
~this
~this()
Undocumented in source.
close
void close()

Close handle

name
string name()

Port name

handle
inout(SPHandle) handle()
reopen
void reopen(string np, Config cfg)
reopen
void reopen(string np)
reopen
void reopen(Config cfg)
reopen
void reopen()
toString
string toString()

Returns extend mode string (example: "/dev/ttyUSB0:38400:8N1")

set
typeof(this) set(T val)

Set config value

set
typeof(this) set(string val)

Set config mode string

closed
bool closed()
config
const(Config) config()

Get config

config
void config(Config c)

Set config

parity
Parity parity [@property getter]
baudRate
uint baudRate [@property getter]
dataBits
DataBits dataBits [@property getter]
stopBits
StopBits stopBits [@property getter]
parity
Parity parity [@property setter]
baudRate
uint baudRate [@property setter]
dataBits
DataBits dataBits [@property setter]
stopBits
StopBits stopBits [@property setter]
listAvailable
string[] listAvailable()

List of available serial ports in system

m_read
void[] m_read(void[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
m_write
size_t m_write(const(void[]) arr)
Undocumented in source. Be warned that the author may not have intended to support it.
setup
void setup(Config conf)

open handler, set new config

m_tcgetattr
void m_tcgetattr(termios* t)
Undocumented in source. Be warned that the author may not have intended to support it.
m_tcsetattr
void m_tcsetattr(int v, const(termios*) t)
Undocumented in source. Be warned that the author may not have intended to support it.
m_ioctl
void m_ioctl(int v, termios2* t)
Undocumented in source. Be warned that the author may not have intended to support it.
posixSetup
void posixSetup(Config conf)
Undocumented in source. Be warned that the author may not have intended to support it.
openPort
void openPort()
Undocumented in source. Be warned that the author may not have intended to support it.
setCC
void setCC(ubyte[2] val)

Set termios.c_ccVMIN and .c_ccVMAX

getCC
ubyte[2] getCC()

Get termios.c_ccVMIN and .c_ccVMAX

initialConfig
void initialConfig(Config conf)
Undocumented in source. Be warned that the author may not have intended to support it.
setUintBaudRate
void setUintBaudRate(uint br)
Undocumented in source. Be warned that the author may not have intended to support it.
getUintBaudRate
uint getUintBaudRate()
Undocumented in source. Be warned that the author may not have intended to support it.
winSetup
void winSetup()
Undocumented in source. Be warned that the author may not have intended to support it.
updTimeouts
void updTimeouts()
Undocumented in source. Be warned that the author may not have intended to support it.
setTimeouts
void setTimeouts(DWORD rit, DWORD rttm, DWORD rttc, DWORD wttm, DWORD wttc)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta