Next: run method, Previous: unset method, Up: MIN2Lua API
The wait
functionality is used for waiting for requested event. Event might be requested before wait is used, but this is not a must. If event has not been requested it will be requested and released in wait function. As a parameters wait takes event name and optional event type which can be StateEvent or IndicationEvent. By default it is IndicationEvent.
Example:
function case_function() -- wait example state event min.wait("Event1"); end function case_function() -- wait example 2 state event min.request("Event1"); min.wait("Event1"); min.release("Event1"); end function case_function() -- wait example state event min.wait("Event1",IndicationEvent); end function case_function() -- wait example 2 state event min.request("Event1",IndicationEvent); min.wait("Event1",IndicationEvent); min.release("Event1",IndicationEvent); end
Note that it is a must to wait for an event of the type the event has been requested.