SoftwareSerial listen() not availabe for UNO R4 WiFi?

If your problem was with the flush() function then using SoftwareSerial won't help because the function does not exist in the SoftwareSerial library