src/VirtualShield.cpp
/// <summary>
/// Process single incoming character - pass to full handler when recognized
/// </summary>
/// <param name="shieldEvent">The shield event.</param>

Process single incoming character - pass to full handler when recognized

The shield event.
Process single incoming character - pass to full handler when recognized The shield event .
bool VirtualShield::processInChar(ShieldEvent* shieldEvent, bool& hasEvent, char c) 
{
    if (c == '{') {
        if (bracketCount++ == 0)
        {
            lastOpening = millis();
        }
    }
    else if (c == '}') {
        if (--bracketCount < 1) {
            bracketCount = 0;
            lastClosure = millis();
            if (readBufferIndex < maxReadBuffer) {
                readBuffer[readBufferIndex++] = '\0';
                inEvent = true;
#ifdef debugSerial
                Serial.print(AWAITING_MESSAGE);
#endif
                _VShieldSerial->write(AWAITING_MESSAGE[0]);
                _VShieldSerial->write(AWAITING_MESSAGE[1]);
                _VShieldSerial->flush();
                lastOpenRequest = millis();
                onStringReceived(readBuffer, readBufferIndex, shieldEvent);
                inEvent = false;
                hasEvent = true;
                readBufferIndex = 0;
                return true;
            }
            readBufferIndex = 0;
        }
    }
    return false;
}
bool VirtualShield :: processInChar ( ShieldEvent * shieldEvent , bool & hasEvent , char c ) { if ( c == ' ' ) { if ( bracketCount ++ == 0 ) { lastOpening = millis ( ) ; } } else if ( c == ' ' ) { if ( -- bracketCount < 1 ) { bracketCount = 0 ; lastClosure = millis ( ) ; if ( readBufferIndex < maxReadBuffer ) { readBuffer [ readBufferIndex ++ ] = ' \0 ' ; inEvent = true ; #ifdef debugSerial Serial . print ( AWAITING_MESSAGE ) ; #endif _VShieldSerial -> write ( AWAITING_MESSAGE [ 0 ] ) ; _VShieldSerial -> write ( AWAITING_MESSAGE [ 1 ] ) ; _VShieldSerial -> flush ( ) ; lastOpenRequest = millis ( ) ; onStringReceived ( readBuffer , readBufferIndex , shieldEvent ) ; inEvent = false ; hasEvent = true ; readBufferIndex = 0 ; return true ; } readBufferIndex = 0 ; } } return false ; }
<summary>
Process single incoming character - pass to full handler when recognized
</summary>
<param name="shieldEvent">The shield event.</param>
<summary > Process single incoming character - pass to full handler when recognized < / summary > <param name = " shieldEvent " > The shield event . < / param >