29.01.2015 Views

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A Flexible Object-Oriented <strong>Software</strong> Architecture 121<br />

While lacking in flexibility compared to more sophisticated techniques (whose<br />

application was ruled out <strong>for</strong> reasons discussed above), this approach was<br />

feasible since the configuration of tracker products would happen entirely at<br />

build time. Furthermore, it represented an efficient choice in the context of<br />

embed<strong>de</strong>d applications as it does not incur any (noteworthy) run-time<br />

overhead.<br />

The static mo<strong>de</strong>l of the tracker product line comprises a number of concurrent<br />

threads, each encapsulated by a class, <strong>for</strong> handling GPS-based position<br />

tracking, the GSM mo<strong>de</strong>m, generic external serial ports, the watchdog, etc.<br />

An additional, central element is resembled by a <strong>de</strong>dicated thread responsible<br />

<strong>for</strong> instantiating and coordinating the other threads in correspon<strong>de</strong>nce<br />

with the hardware configuration. Figure 9-6 gives an overview of the basic<br />

application structure.<br />

As <strong>for</strong> the dynamic mo<strong>de</strong>l, behavior was mo<strong>de</strong>led using activity, state, and<br />

sequence diagrams. Since the basic nature of the tracker application is dataprocessing<br />

rather than state-driven, state diagrams did not play a major role,<br />

ruling out the use of state-diagram-based co<strong>de</strong> generation. Instead, implementation<br />

was done manually in C++. Since methods’ implementations were<br />

entered within the UML tool, a run of the co<strong>de</strong> generator nevertheless yiel<strong>de</strong>d<br />

complete application co<strong>de</strong>.<br />

The configuration of a concrete application of the tracker product line is<br />

achieved by adapting a source co<strong>de</strong> file taking care of the instantiations<br />

<strong>de</strong>scribed above. By commenting out instantiations or substituting other<br />

sub-classes, an application can be configured in correspon<strong>de</strong>nce with a given<br />

hardware configuration. Alternatively, to make things more com<strong>for</strong>table, a<br />

GUI-driven configuration tool generating the instantiation co<strong>de</strong> could be<br />

implemented easily.<br />

6. CONCLUSIONS AND OUTLOOK<br />

Thanks to the combination of framework and product line <strong>de</strong>velopment, the<br />

flexibility of the software <strong>de</strong>signed in the course of the project clearly surpasses<br />

that of the previous, conventional implementation.<br />

The approaches chosen to mo<strong>de</strong>l variabilities in UML have proven suitable<br />

to accommodate the requirements of the software architecture. Thanks to the<br />

template-based co<strong>de</strong> generation facility provi<strong>de</strong>d by Real-Time Studio, the<br />

stereotypes used could be mapped to customizations of co<strong>de</strong> generation templates,<br />

thus linking the mo<strong>de</strong>led variability to the source co<strong>de</strong> level. Combined<br />

with methods’ bodies implemented within the UML tool, “single-click” co<strong>de</strong><br />

generation has been shown to be feasible. This automation avoids the danger<br />

of introducing inconsistencies among mo<strong>de</strong>l and co<strong>de</strong> which are likely to result<br />

from the need to manually adapt characteristics at both levels while offering<br />

a high <strong>de</strong>gree of flexibility with respect to variabilities at both the OS/hardware<br />

plat<strong>for</strong>m and application end of the spectrum.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!