Documentos de Académico
Documentos de Profesional
Documentos de Cultura
The first thing you should do to start working with GivovynetSerialPort is to create
an object of class "Parameters" of the package "app." This class has set the
following default parameters:
port = COM1
baudRate = 9600
byteSize = 8
stopBits = 1
parity = N (no)
Then create an object "Com" of the package "app." This object require as
parameter the object of type "Parameters" created earlier, then it uses the
methods of the "Com" to send or receive data, as required.
If you need to change the default settings, use the methods setPort, setBaudRate,
setByteSize, setStopBits and setParity, to more clearly see the following
examples:
Example 1: Open port COM1 with baud rate 9600, byte size 8, 1 stop bits and no
parity.
sendArrayChar method.
}
Will be send '1' after 500 milliseconds will be send '2', this
way until to send 'B'.
This method is used to send one char data or one int data
or one String data or Hex data.
By example, somebody wants to send: 'a' (char type),
then 41 (int type), then "S" (String type), then 0xff (Hex
type), therefore...
com1.sendSingleData('a');
com1.sendSingleData(41);
com1.sendSingleData("S");
com1.sendSingleData(0xff);
sendString method.
receiveSingleChar method.
receiveSingleDataInt method.
receiveSingleString method.