Open
Description
Anytime I do a hot restart on my flutter app after the port has been initialized, I get this error:
Unhandled Exception: SerialPortError: Device or resource busy, errno = 16
Basically my app runs through this initialization process during every hot restart:
- Close/Dispose the port if it already exists
- Create new SerialPort instance
- OpenReadWrite
- Set Baud Rate
- Create new SerialPortReader instance
- Listen to data
I get this error at step 3 after a hot restart.
My guess is that the port is not disposed correctly and when a new port gets opened for read/write the OS throws this error because the old port still exists in memory.
This is on Android 7.1 btw.
Any suggestions on how to solve this?
Thanks
Metadata
Metadata
Assignees
Labels
No labels