user4295: My project involves and RFID reader connected to an Arduino Pro Mini (5V, 16MHz) and an Adafruit CC3000 breakout WiFi chip. The device reads RFID tags and sends them to my web service. I am using Software Serial to read the RFID device data.
After I scan something, the Arduino tries to send the value that was read to the web service. This obviously causes a delay and the program only continues execution (i.e. next iteration of the loop() function) after the data has been sent.
My problem is simple. While the value is being sent, the serial buffer is can still accept scans from the RFID reader and on subsequent iterations, because there is data in the buffer the device attempts to send data again.
My question is how can I stop the software serial port from receiving data while I am trying to send data to the web service? Then when the data is sent successfully, how can I re-enable the software serial port from accepting data?

user6678: Whether or not the serial data becomes available really does not matter.  If you flush the port before every read rather than consuming the data, let 'er rip.  If you are using interrupts, toggle interrupts on the serial pin.

user10020: According to the docs, SoftwareSerial doesn't support .end(), so Gerben's answer won't work here, I think. 
It's hacky, but you could exploit the fact that only one SoftwareSerial can receive data at a time, and create a second one, activating it with SoftwareSerial.listen().  Then .listen() again on your original SoftwareSerial, when you want to resume listening.
Or, you could do as Marty Grogan says, and flush the read buffer before starting a new read.  Again, I don't think SoftwareSerial supports a flush method as such, so you'd need to just .read() until there's nothing .available().

user2881: Call serial.end() to stop receiving. 
Then call serial.begin(...) again when you want to start listening again.

4295: <p>My project involves and RFID reader connected to an Arduino Pro Mini (5V, 16MHz) and an Adafruit CC3000 breakout WiFi chip. The device reads RFID tags and sends them to my web service. I am using Software Serial to read the RFID device data.</p>

<p>After I scan something, the Arduino tries to send the value that was read to the web service. This obviously causes a delay and the program only continues execution (i.e. next iteration of the loop() function) after the data has been sent.</p>

<p>My problem is simple. While the value is being sent, the serial buffer is can still accept scans from the RFID reader and on subsequent iterations, because there is data in the buffer the device attempts to send data again.</p>

<p>My question is how can I stop the software serial port from receiving data while I am trying to send data to the web service? Then when the data is sent successfully, how can I re-enable the software serial port from accepting data?</p>
 6678: <p>Whether or not the serial data becomes available really does not matter.  If you flush the port before every read rather than consuming the data, let 'er rip.  If you are using interrupts, toggle interrupts on the serial pin.</p>
 10020: <p>According to <a href="http://www.arduino.cc/en/Reference/SoftwareSerial" rel="nofollow">the docs</a>, SoftwareSerial doesn't support <code>.end()</code>, so Gerben's answer won't work here, I think. </p>

<p>It's hacky, but you could exploit the fact that only one SoftwareSerial can receive data at a time, and create a second one, activating it with <code>SoftwareSerial.listen()</code>.  Then <code>.listen()</code> again on your original SoftwareSerial, when you want to resume listening.</p>

<p>Or, you could do as Marty Grogan says, and flush the read buffer before starting a new read.  Again, I don't think SoftwareSerial supports a flush method as such, so you'd need to just <code>.read()</code> until there's nothing <code>.available()</code>.</p>
 2881: <p>Call <a href="https://github.com/arduino/Arduino/blob/3a8ad75bcef5932cfc81c4746a87ddbdbd7e6402/libraries/SoftwareSerial/SoftwareSerial.cpp#L415-419">serial.end()</a> to stop receiving. </p>

<p>Then call <code>serial.begin(...)</code> again when you want to start listening again.</p>
