TelluIoT / ThingML

The ThingML modelling language
https://github.com/TelluIoT/ThingML
Apache License 2.0
103 stars 32 forks source link

Timer protocol does not work for posix #222

Closed antons1 closed 6 years ago

antons1 commented 6 years ago

It seems like the Timer protocol does not work for posix.

Given this model:

thing fragment TimerMsgs {
    message second() @xms_tic "1000"
}

thing fragment TimerClient includes TimerMsgs {
    required port TimerPort {
        receives second
    }
}

thing TimerThing includes TimerClient {
    statechart init Timing {
        state Timing {
            on entry `fprintf(stderr, "%s", "Starting...\n");`
            internal event TimerPort?second
            action `fprintf(stderr, "%s", "This was a second.\n");`
        }
    }
}

protocol Timer;

configuration TimerCfg {
    instance tt: TimerThing
    connector tt.TimerPort over Timer
}

I would expect the compiled program to print This was a second. every second, but it only prints Starting..., and then does nothing.

brice-morin commented 6 years ago

as a temporary work around, you can try the good old timers

brice-morin commented 6 years ago

timers are now to be used through the STL import "timers.thingml" from stl