This part will give an overview how to develop your communication
interface between the target and the PC. This plugin allow the
Embedded
UML Target Debugger on the PC to read and write data from / to the target
board through different interfaces. You principally need to implement this part on the PC part (host) and
the monitor part on target.
Embedded UML Target Debugger Communication Interface.
The Embedded
UML Target Debugger needs to communicate with the target. This part is
already implemented for a serial interface as an example. More ready to
use interfaces might be available, you should contact Willert Software
Tools for a list of currently available plugins. But it's also possible
to implement a custon interface on your target and for Qt.. You need to
implement functions to initialize, read and
write on you communication port. You need also to know how Qt works and
more precisely the signal and slot concept.
To implement the plugin, it's recommend to use QtCreator
IDE to develop it. You can download it for free at
http://qt.nokia.com/downloads
There is a template class available named
"MyCommunicationPlugIn". You can rename this class for your
convenience but you need to rename also the name in the Qt project file
(.pro). You can see that this class implements Communication, a
class interface that allow the Embedded UML Target Debugger to know
which
class can be called. You can not modify this class interface. Moreover
you need to define those classes of the Communication interface.
On MyCommunicationPlugin class, there are multiple functions:
- void initCom():
it needs to be implemented to initialize
your communication plug in. You need to emit a signal to the Embedded
UML Target Debugger to signal that the communication is ready. This should be done using
communicationEstablished().
- char* read() : inside this fiunction, you need to insert a thread or event driven (preferable) functionality to read all
available bytes from your communication port from the target. This function must
write the number of bytes (numBytes) and the data (readBuffer). At the end you need to send the readBuffer and the
number of bytes to the Embedded UML Target debugger via a signal (emit newCommand(
readBuffer, numBytes )).
- void write(char[] , int length) :
this function is directly called from the Embedded
UML Target Debugger
and allow to write the data inside the table with the length of
the table as second argument. This data must be send to the target via your communication interface.
- bool initialization(bool config) : this function is directly called from the Embedded
UML Target Debugger
and
initializes the config dialogbox and the link between the dialog box
view and MyCommunicationPlugin data model. In this function you can
change the name and the list of parameter in .cpp and .h. You can also
modify the slot function parameter to your own needs here. If you want to design the config dialog box you need to open the configdialog.ui file with
QtCreator. If you click on the combo box, you can change on the right
bottom hand side the object name, that you will call in
the MyCommunication plugin with myDialogBox->getUi()->parameter1Box.
So for each object, you want to edit in the CommunicationPlugin from
configDiaolog.ui, you just need to check the objectName and call
myDialogBox->getUi()-> < yourObjectName > . Moreover, it's
possible to add other boxes but you just need to connect them with the
communcation plugin like in the communicationPlugIn.cpp and add a slot
function that calls it when the user changes it.
- void close() : Needs to be implemented to close MyCommunicationPlugIn..