Serial Port Source is a source component aimed at consuming data from a serial port usually implementing RS-232 standard.

FQCN

com.datumize.ddc.serialport.component.SerialPortSource

Overview

The serial port is one of the most used interfaces, based on RS-232 standard, before the IP stack became popular. Reads from the serial port, an extremely slow port. The operating system where DDC is running must have a valid serial port configured.

This source component implements a polling client for a serial port that is capable of sending out some data, wait and retrieve some data. Both the send and received data can be properly adapted using converters. Please keep in mind that serial ports are slow, and speed (in bauds) is important.

It is recommended that only 1 thread is executing the pipeline containing this source. The duration between calls MUST be enough the get previous response, otherwise you will get serial port error.

Properties


Common properties that apply to all source and processor components of a pipeline.

PROPERTYIDDESCRIPTION

REQUIRED

TYPE

DEFAULT

EXAMPLES

Common
IdentifierIDComponent unique Identifier within the pipeline, read only, only useful for advanced mode.YesStringAuto

MyComponent_23423

This Identifier is automatically generated by the system and you can't change it. Might be helpful for advanced pipeline configuration.

DescriptiondescriptionA short description for the component, to be visualized inside the component representation, aimed at providing additional information to understand the pipeline at a glance.NoString

Extract customer id and loyalty number.

Short and sweet description.

TopictopicAll Source and Processor components support a topic to tag the output records. If the record does not have a tag applied, this topic will be automatically applied. The topic may be used by future components to route, group or classify records.NoString

foo

All output records will be tagged using "foo", unless they have not been tagged during the execution of the step.

PROPERTYIDDESCRIPTIONREQUIREDTYPEDEFAULTEXAMPLES
Default
Port nameserial-portSerial port name.YesString

/dev/ttyS4

Unix-like device that represents a serial port. Each operating system uses its own naming conventions for serial ports.

Command requestcommand

Command request as a byte stream, to be sent over serial connection.

YesSee Commands

Serial Script or Serial Port Command

ResponsedeserializerDeserializer that receives a byte stream from the serial port, and converts into an object that is meaningful.YesSee Deserializers

Serial
Bauds

baud

Baudes

No

Integer

9600


Transfer bits

transfer-bits

Number of transfer bits

No

Integer

8


Stop bits

stop-bits

Number of stop bits

No

Integer

1


Parity bit

parity

Bit parity to use

No

Integer

1 (even)


Response waiting time

wait

Waiting time for response

No

Duration

100ms


Advanced
End of result character

end-result-mark-policy

Selects a policy to process result bytes until a certain character is found. Do not configure end of result to use a character and number of bytes at the same time.

No

String


?

Process result until ? character is found.

End of result bytes

bytes-result-length-policy

Selects a policy to process result bytes for a certain buffer length. Do not configure end of result to use a character and number of bytes at the same time.

No

Integer


1024

Process result until 1024 bytes are read.

Commands

A command will return a byte array with the serialized command to send thought the serial port.

Script Command

Create a complete custom command using a scripting language. See DDC Extensibility (SDK) for more information. Script Command allows custom commands, although you must consider the scripting language overhead in runtime.

PROPERTYIDDESCRIPTIONREQUIREDTYPEDEFAULTEXAMPLES
ScriptscriptScript to convert input to outputStringYes

Languagelanguage

Language compatible with the JVM in which operations are written.

Note: the language pack must be installed in the system.

Script LanguageNogroovy

javascript

Select the  scripting language to be Javascript.

ParametersparametersScript optional parameters

Parameter List



param1=val1,val2;param2=va3
DependenciesdependenciesPath to external jars that will be added to the classloaderNoList of Paths
/home/acme/coyote.jar
Bootstrap scriptscript-bootstrapScript to execute when the step is initialized. Useful to initialize classesNoString