mirror of
				https://github.com/KevinMidboe/TinyGSM.git
				synced 2025-10-29 18:00:18 +00:00 
			
		
		
		
	merged master
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -27,3 +27,4 @@ lib/readme.txt | ||||
|  | ||||
| # Extras | ||||
| extras/docs/* | ||||
| extras/Module Datasheets/* | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "TinyGSM", | ||||
|   "version": "0.4.3", | ||||
|   "version": "0.4.4", | ||||
|   "description": "A small Arduino library for GPRS modules, that just works. Includes examples for Blynk, MQTT, File Download, and Web Client. Supports many GSM and wifi modules with AT command interfaces.", | ||||
|   "keywords": "GSM, AT commands, AT, SIM800, SIM900, A6, A7, M590, ESP8266, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968, M95, MC60, MC60E, BG96, ublox", | ||||
|   "authors": | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| name=TinyGSM | ||||
| version=0.4.3 | ||||
| version=0.4.4 | ||||
| author=Volodymyr Shymanskyy | ||||
| maintainer=Volodymyr Shymanskyy | ||||
| sentence=A small Arduino library for GPRS modules, that just works. | ||||
|   | ||||
| @@ -121,7 +121,8 @@ public: | ||||
|   virtual int read(uint8_t *buf, size_t size) { | ||||
|     TINY_GSM_YIELD(); | ||||
|     size_t cnt = 0; | ||||
|     while (cnt < size && sock_connected) { | ||||
|     uint32_t _startMillis = millis(); | ||||
|     while (cnt < size && millis() - _startMillis < _timeout) { | ||||
|       size_t chunk = TinyGsmMin(size-cnt, rx.size()); | ||||
|       if (chunk > 0) { | ||||
|         rx.get(buf, chunk); | ||||
| @@ -130,7 +131,7 @@ public: | ||||
|         continue; | ||||
|       } | ||||
|       // TODO: Read directly into user buffer? | ||||
|       if (!rx.size()) { | ||||
|       if (!rx.size() && sock_connected) { | ||||
|         at->maintain(); | ||||
|       } | ||||
|     } | ||||
|   | ||||
| @@ -122,7 +122,7 @@ public: | ||||
|     TINY_GSM_YIELD(); | ||||
|     at->maintain(); | ||||
|     size_t cnt = 0; | ||||
|     while (cnt < size && sock_connected) { | ||||
|     while (cnt < size) { | ||||
|       size_t chunk = TinyGsmMin(size-cnt, rx.size()); | ||||
|       if (chunk > 0) { | ||||
|         rx.get(buf, chunk); | ||||
|   | ||||
| @@ -118,7 +118,8 @@ public: | ||||
|   virtual int read(uint8_t *buf, size_t size) { | ||||
|     TINY_GSM_YIELD(); | ||||
|     size_t cnt = 0; | ||||
|     while (cnt < size && sock_connected) { | ||||
|     uint32_t _startMillis = millis(); | ||||
|     while (cnt < size && millis() - _startMillis < _timeout) { | ||||
|       size_t chunk = TinyGsmMin(size-cnt, rx.size()); | ||||
|       if (chunk > 0) { | ||||
|         rx.get(buf, chunk); | ||||
| @@ -127,7 +128,7 @@ public: | ||||
|         continue; | ||||
|       } | ||||
|       // TODO: Read directly into user buffer? | ||||
|       if (!rx.size()) { | ||||
|       if (!rx.size() && sock_connected) { | ||||
|         at->maintain(); | ||||
|       } | ||||
|     } | ||||
|   | ||||
| @@ -118,7 +118,8 @@ public: | ||||
|   virtual int read(uint8_t *buf, size_t size) { | ||||
|     TINY_GSM_YIELD(); | ||||
|     size_t cnt = 0; | ||||
|     while (cnt < size && sock_connected) { | ||||
|     uint32_t _startMillis = millis(); | ||||
|     while (cnt < size && millis() - _startMillis < _timeout) { | ||||
|       size_t chunk = TinyGsmMin(size-cnt, rx.size()); | ||||
|       if (chunk > 0) { | ||||
|         rx.get(buf, chunk); | ||||
|   | ||||
| @@ -122,7 +122,7 @@ public: | ||||
|     TINY_GSM_YIELD(); | ||||
|     at->maintain(); | ||||
|     size_t cnt = 0; | ||||
|     while (cnt < size && sock_connected) { | ||||
|     while (cnt < size) { | ||||
|       size_t chunk = TinyGsmMin(size-cnt, rx.size()); | ||||
|       if (chunk > 0) { | ||||
|         rx.get(buf, chunk); | ||||
|   | ||||
| @@ -126,7 +126,7 @@ public: | ||||
|     TINY_GSM_YIELD(); | ||||
|     at->maintain(); | ||||
|     size_t cnt = 0; | ||||
|     while (cnt < size && sock_connected) { | ||||
|     while (cnt < size) { | ||||
|       size_t chunk = TinyGsmMin(size-cnt, rx.size()); | ||||
|       if (chunk > 0) { | ||||
|         rx.get(buf, chunk); | ||||
|   | ||||
| @@ -135,7 +135,7 @@ public: | ||||
|     TINY_GSM_YIELD(); | ||||
|     at->maintain(); | ||||
|     size_t cnt = 0; | ||||
|     while (cnt < size && sock_connected) { | ||||
|     while (cnt < size) { | ||||
|       size_t chunk = TinyGsmMin(size-cnt, rx.size()); | ||||
|       if (chunk > 0) { | ||||
|         rx.get(buf, chunk); | ||||
| @@ -144,6 +144,13 @@ public: | ||||
|         continue; | ||||
|       } | ||||
|       // TODO: Read directly into user buffer? | ||||
|       // Workaround: sometimes SIM800 forgets to notify about data arrival. | ||||
|       // TODO: Currently we ping the module periodically, | ||||
|       // but maybe there's a better indicator that we need to poll | ||||
|       if (millis() - prev_check > 500)  { | ||||
|         got_data = true; | ||||
|         prev_check = millis(); | ||||
|       } | ||||
|       at->maintain(); | ||||
|       if (sock_available > 0) { | ||||
|         sock_available -= at->modemRead(TinyGsmMin((uint16_t)rx.free(), sock_available), mux); | ||||
|   | ||||
| @@ -120,7 +120,7 @@ public: | ||||
|     TINY_GSM_YIELD(); | ||||
|     at->maintain(); | ||||
|     size_t cnt = 0; | ||||
|     while (cnt < size && sock_connected) { | ||||
|     while (cnt < size) { | ||||
|       size_t chunk = TinyGsmMin(size-cnt, rx.size()); | ||||
|       if (chunk > 0) { | ||||
|         rx.get(buf, chunk); | ||||
|   | ||||
| @@ -578,6 +578,8 @@ public: | ||||
|   bool networkDisconnect() { | ||||
|     if (!commandMode()) return false;  // return immediately | ||||
|     sendAT(GF("NR0"));  // Do a network reset in order to disconnect | ||||
|     // NOTE:  On wifi modules, using a network reset will not | ||||
|     // allow the same ssid to re-join without rebooting the module. | ||||
|     int res = (1 == waitResponse(5000)); | ||||
|     writeChanges(); | ||||
|     exitCommand(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user