kbLogger 2.0.b1
The automotive ready test and logging program.
ConfigItemComObject Class Reference

This class defines the API of the ConfigItemComObject.

#include <configitemcomobject.h>

Public Slots

ComDevice related functions.
virtual QString getConfiguration ()
 
virtual ScriptValue getConfiguration (QString strKey)
 
virtual void setBinMode (bool bBinMode)
 Set the binary mode.
 
virtual void handleCommand (QString strCommand)
 Handle ComDevice specific commands.
 
ComDeviceRs232 related functions.
virtual void RS232_setBaudRate (int BaudRate)
 Set the BaudRate.
 

Member Function Documentation

◆ getConfiguration [1/2]

QString getConfiguration ( )
virtualslot

Get the configuration of the ConfigItemComObject

The ConfigItem has settings in the project file (*.klp). All of those key value pairs are returned in a string like this: "key1=value1,key2=value2"

Example:

var serialPort = so.configItem("serialPort");
var config = serialPort.getConfiguration();
var value1 = so.extractVariable("key1");
so.trace("value1=" + value1);
Returns
A string with the complete settings.

◆ getConfiguration [2/2]

ScriptValue getConfiguration ( QString strKey)
virtualslot

Get the configuration of the ConfigItemComObject

The ConfigItem has setting for the given key in the project file (*.klp).

Example:

var value1 = so.configItem("serialPort").getConfiguration("key1");
so.trace("value1=" + value1);
Returns
A string with the value of the key

◆ handleCommand

void handleCommand ( QString strCommand)
virtualslot

Handle ComObject specific commands.

In this moment, possible commands are: "open", "close", "reopen"

Example:

var ssh = so.findReceiver("ssh"); // Find the ComObjectProcess wich handles ssh connection
ssh.handleCommand("reopen"); // Reconnect to the ssh target
Parameters
strCommand

◆ RS232_setBaudRate

void RS232_setBaudRate ( int BaudRate)
virtualslot

This function is changing the BaudRate of the ComObject in case the ComObject is of type Rs232Object.

Example:

var serialPort = so.configItem("serialPort");
serialPort.RS232_setBaudRate(921600);
Parameters
BaudRateThe baud rate to set.

◆ setBinMode

void setBinMode ( bool bBinMode)
virtualslot

Set the binary mode.

Example:

var serialPort = so.configItem("serialPort");
serialPort.setBinMode(true);
Parameters
bBinModeSet to true to activate the binary mode, otherwise set it to false.