@ one of your threads(cbf to link) instead of a while look checking available() just use in.read() it will block the thread until data is received