We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7366268 commit 3f02bcbCopy full SHA for 3f02bcb
libraries/SoftwareSerial/SoftwareSerial.cpp
@@ -195,6 +195,17 @@ bool SoftwareSerial::listen()
195
return false;
196
}
197
198
+// Stop listening. Returns true if we were actually listening.
199
+bool SoftwareSerial::stopListening()
200
+{
201
+ if (active_object == this)
202
+ {
203
+ active_object = NULL;
204
+ return true;
205
+ }
206
+ return false;
207
+}
208
+
209
//
210
// The receive routine called by the interrupt handler
211
libraries/SoftwareSerial/SoftwareSerial.h
@@ -87,6 +87,7 @@ class SoftwareSerial : public Stream
87
bool listen();
88
void end();
89
bool isListening() { return this == active_object; }
90
+ bool stopListening();
91
bool overflow() { bool ret = _buffer_overflow; _buffer_overflow = false; return ret; }
92
int peek();
93
0 commit comments