Software Architectures/Standards for embedded Sensor menues?

Hello,

I am a software engineer coming from a more higher layer background (OOP, GUI-development), but now I will probably face an embedded software project.

I would like to know if there exist software architectures, standards, guidelines etc. for the menue software in a sensor device. That is, the device consists of 3 or more keys to walk through a menu tree. The sensor device has a display that is connected to the processor (via a controller). I guess that devices like this one abound, so there could be something like a standard for this.

Note that I don't mean the menu / menu tree itsself. It is more or less fixed. What the guys here want me to do is to develop the software handling the menue, but in a very clean and modular way. The software should be adopted to other sensors (same processor / os, but different menu) with minimized effort. Also, documentation, life-cycle models (V-Model) and so on are very important in this company. They want another guy to join a similar project with a different menue structure. I should also lead this guy and concentrate on architecture and design.

From what I have seen, the menue tree doesn't seem too complex.

I have first thought on something like the GoF State-Pattern or the Command Pattern, but the programming language is c. I am not sure if it is worth to do object oriented c, and if other programmers are used to it. On the other hand, I don't like (non object oriented) finite state machines. You end up with a huge while loop that nobody will ever understand.

Sure, there should probably be a menue part, a process part, and a display part (something like model-view-controller).

It would be nice if there are already (defacto) standards or if somebody of you experts could give me some advice.

The protocol between the Display controller and the Processor isn't specified either, well, it's SPI, but this is just the hardware. I am looking for the higher layers. Maybe there is some kind of standard API for this as well.

The Processor is PowerPC and the OS is (embedded) Linux if that matters. I don't seem to have run-time or space constraints.

Best regards

Johannes

Reply to
Johannes Eble
Loading thread data ...

Why don't you use C++ to implement the GoF state pattern?

I am pretty sure the Linux compiler does support C++.

-- EventStudio 2.5 -

formatting link
Real-time and Embedded System Modeling with Sequence Diagrams

Reply to
EventHelix.com

Hi Lanarcam,

thank very much for your answer.

...

You mean "Keep it simple", right?

What notation do you use here and how does it translate to c?

I have thought about something like:

struct state { int key; void (*action)(); struct state *nextState; };

That is, a structure representing a state. The state consists of a key, a pointer to a function (i.e. action) and the next state.

Then, in the main while loop:

struct state *ptr_currState; ... while(...) { (*action)(); switch(ptr_currState->key) { case ....: ptr_currState->nextState = ....; break; ... } }

The while loop and the main control logic will still get too complex for my taste. But at least the work is split somewhat in smaller pieces.

Regards

Johannes

Reply to
Johannes Eble

Hi,

thanks very much for your advice.

The compiler surely supports C++, it's the standard GNU toolchain. I'll check if I am allowed to use C++. On the other hand, I am new here, and I don't have an overview over what part(s) of the system are already there and in C. I don't want to mix C and C++ without a serious reason.

I have some other ideas, e.g. to use some kind of configuration file for the menu tree, but this is probably overkill too.

Johannes

Reply to
Johannes Eble

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.