Accessing the parameters of the consumed event
The params
keyword
provides access to
the parameters of the consumed event.
About this task
For
example,
in the following
transition,
the value of the occupancy parameter passed with the updateOcc()
event
received by the OccSensor
object is passed as the
second parameter of the set_occStat()
operation:
updateOcc()/
OccSensor_set_occStat(me, params->occupancy);
In this example, the updateOcc()
event
is the trigger of the transition and the OccSensor_set_occStat()
call
is part of the action that is executed as a result.
In
other words, when the OccSensor
object receives an updateOcc()
event
with a parameter of 1, updateOcc(1)
, the sensor's occStat
attribute
is updated with the value 1 as a result.