src/VirtualShield.cpp
/// <summary>
/// Receives events as long as they exist, or until an optional timeout occurs.
/// </summary>
/// <param name="watchForId">An id to return true if found. Otherwise true is returned for any events processed.</param>
/// <param name="timeout">The timeout in milliseconds.</param>
/// <returns>true if the id matched an incoming event, or if no id, any event.</returns>

Receives events as long as they exist, or until an optional timeout occurs.

An id to return true if found. Otherwise true is returned for any events processed.
The timeout in milliseconds.
true if the id matched an incoming event, or if no id, any event.
Receives events as long as they exist or until an optional timeout occurs . An id to return true if found . Otherwise true is returned for any events processed . The timeout in milliseconds . true if the id matched an incoming event or if no id any event .
bool VirtualShield::checkSensors(int watchForId, int32_t timeout, int watchForResultId) {
	bool hadEvents = false;
	uint32_t started = millis();
	recentEventErrorId = 0;
	while (getEvent(&recentEvent) && (timeout == 0 || started+timeout <= millis()) ) {
		hadEvents = (watchForId == 0 || recentEvent.id == watchForId) && (watchForResultId == -1 || recentEvent.resultId == watchForResultId);
	}
	return hadEvents;
}
bool VirtualShield :: checkSensors ( int watchForId , int32_t timeout , int watchForResultId ) { bool hadEvents = false ; uint32_t started = millis ( ) ; recentEventErrorId = 0 ; while ( getEvent ( & recentEvent ) && ( timeout == 0 || started + timeout <= millis ( ) ) ) { hadEvents = ( watchForId == 0 || recentEvent . id == watchForId ) && ( watchForResultId == -1 || recentEvent . resultId == watchForResultId ) ; } return hadEvents ; }
<summary>
Receives events as long as they exist, or until an optional timeout occurs.
<summary > Receives events as long as they exist or until an optional timeout occurs .