Boost logo

Boost :

Subject: Re: [boost] [MSM] Comparison with ad-hoc FSM implementation
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2009-12-11 10:56:18


Christophe Henry wrote:
>>Do we have any concrete examples of larger problems anywhere? I would
>>be interested to see them so that I can consider how I would implement them.
>
> Sure. Please have a look in the MSM doc at the MsmSession_Handout.pdf.
> At the last page, you'll see the description of an iPod nano.

Thanks, that is useful.

One interesting feature is that there are several buttons that have
different actions associated with short and long presses. So I can
imagine per-button state machines that do something like:

  UP --pressed--> DOWN --timeout--> LONG_DOWN
      <--released---- |
      <---------------------released--------+

These could feed events like left_button_short_press,
right_button_long_release etc into a main state machine.

Can you outline how you would implement this in MSM? I can see how you
could store the button identifier as event state and send e.g.
short_press(left_button) to the main state machine, but this would then
need transition rules using guards to test the button id. (I don't
think this is an application for a sub state machine because each
button's machine runs concurrently, right?)

Thanks, Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk