mirror of
				https://github.com/KevinMidboe/TinyGSM.git
				synced 2025-10-29 18:00:18 +00:00 
			
		
		
		
	add timeout to streamSkipUntil
This commit is contained in:
		| @@ -412,9 +412,13 @@ public: | ||||
|     streamWrite(tail...); | ||||
|   } | ||||
|  | ||||
|   bool streamSkipUntil(char c) { //TODO: timeout | ||||
|     while (true) { | ||||
|       while (!stream.available()) { TINY_GSM_YIELD(); } | ||||
|   bool streamSkipUntil(char c) { | ||||
|     const unsigned long timeout = 1000L; | ||||
|     unsigned long startMillis = millis(); | ||||
|     while (millis() - startMillis < timeout) { | ||||
|       while (millis() - startMillis < timeout && !stream.available()) { | ||||
|         TINY_GSM_YIELD(); | ||||
|       } | ||||
|       if (stream.read() == c) | ||||
|         return true; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user