Added extra "ping" for data to read() of SIM800
This commit is contained in:
		
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -27,3 +27,6 @@ extras/docs/*
 | 
				
			|||||||
.gcc-flags.json
 | 
					.gcc-flags.json
 | 
				
			||||||
platformio.ini
 | 
					platformio.ini
 | 
				
			||||||
lib/readme.txt
 | 
					lib/readme.txt
 | 
				
			||||||
 | 
					.vscode/.browse.c_cpp.db*
 | 
				
			||||||
 | 
					.vscode/c_cpp_properties.json
 | 
				
			||||||
 | 
					.vscode/launch.json
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -144,6 +144,13 @@ public:
 | 
				
			|||||||
        continue;
 | 
					        continue;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      // TODO: Read directly into user buffer?
 | 
					      // 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();
 | 
					      at->maintain();
 | 
				
			||||||
      if (sock_available > 0) {
 | 
					      if (sock_available > 0) {
 | 
				
			||||||
        sock_available -= at->modemRead(TinyGsmMin((uint16_t)rx.free(), sock_available), mux);
 | 
					        sock_available -= at->modemRead(TinyGsmMin((uint16_t)rx.free(), sock_available), mux);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user