
Chapter 4. Implementation 50
the RFM22B, the output streams are sometimes fragmented during CPU intensive tasks, such as
the reception of HA protocols. These fragments are shorts breaks in the continuous data stream
and cause the QextSerialPort to break it into smaller pieces sometimes. However, this problem
does not occur with other serial programs. Both the serial class and the TCP class perform this
kind of filtering, as the TCP class is very similar to the serial class, except that it inherits from
the class QTcpSocket, a TCP client class from the Qt framework. The serial and TCP classes are
child objects of the gateway class, a further abstraction layer and interface for the used gateway.
It offers the same functionality as the gateway driver node, such as raw input, protocol input and
protocol output, but without the ROS functionality. This is added by the rosnode object, a simple
node for ROS to signal/slot and data type conversion. If a message is received by the gateway, it
is sent via USB to the computer, where it is converted into a virtual serial data stream by a virtual
serial driver. This stream can be read by the serial class, where it is filtered into single command
messages and transferred through the gateway class to the rosnode object by signals and slots.
The rosnode object then converts it into a protocol.msg and publishes it. The other way round,
it works exactly the same.
4.4. Device manager
The device manager is a powerful database node with two important tasks: it connects protocols
with a set of data (see figure 3.5 on page 32) and monitors and manages the states of different
HA devices. The connection of protocols with sets of data will abstract the device protocol to a
device name and id and therefore it enables device handling without knowledge of their protocol
codes and types (HE or IT). Furthermore, data is more human readable and can be more easily
filtered and processed, due to the additional information. The data is stored in a database and
special lookup and control functions allow management of the HA system by simply changing
entries in the database. Figure 4.13 shows the device manager with its services, publishers and
subscribers.
The device manager is connected to the gateway driver via two topics: the protocol input and
output. The protocol input is connected to the protocol output of the gateway driver for receiving
abstracted protocol data. The protocol output is connected to the protocol input of the gateway
driver, which gives the device manager control over HA devices. Beside these two topics, the
device manager also provides services and topics for subsequent nodes. These services are:
Manipulation of database entries: an add/remove/change service for both senders and re-
ceivers, which allows manipulation of the database. This direct manipulation of the database
will not cause the device manager to send the corresponding protocol messages to the gate-
way, if the state of a device entry is changed. To actually change the HA devices, use the
switch receiver/sender topics or services. Theoretically, the change service can be replaced
Comentarios a estos manuales