Photomechanics API
SerialDataTransport Class Reference

Messages transport for serial port. When connected via USB, turntables appear as COM ports. More...

Inheritance diagram for SerialDataTransport:
[legend]

Public Member Functions

 SerialDataTransport (SerialPort serialPort, ILogger logger)
 Construct messages transport using provided SerialPort. More...
 
ValueTask DisposeAsync ()
 
ValueTask Write (String data)
 Send string to turntable. More...
 
ValueTask Write (String data)
 Send string to turntable. More...
 

Properties

ILogger Logger [get]
 
IObservable< Char > CharReceived [get]
 Occurs when char is received from turntable. More...
 
String ConnectionInfo [get]
 ITurntableApi.ConnectionInfo. More...
 
- Properties inherited from IDataTransport
IObservable< Char > CharReceived [get]
 Occurs when char is received from turntable. More...
 
String ConnectionInfo [get]
 ITurntableApi.ConnectionInfo. More...
 

Detailed Description

Messages transport for serial port. When connected via USB, turntables appear as COM ports.

It is recommended to have reasonable write timeout of underlying SerialPort. Otherwise, if COM port used is not Photomechanics turntable, API might hang on "write" operation instead of self-disposing. Read timeout of underlying COM port should be infinite.

Constructor & Destructor Documentation

◆ SerialDataTransport()

SerialDataTransport.SerialDataTransport ( SerialPort  serialPort,
ILogger  logger 
)

Construct messages transport using provided SerialPort.

Ensure that provided SerialPort is compliant with requirements mentioned in SerialDataTransport description.

Member Function Documentation

◆ Write()

ValueTask SerialDataTransport.Write ( String  data)

Send string to turntable.

Implements IDataTransport.

Property Documentation

◆ CharReceived

IObservable<Char> SerialDataTransport.CharReceived
get

Occurs when char is received from turntable.

Implements IDataTransport.

◆ ConnectionInfo

String SerialDataTransport.ConnectionInfo
get