Android Question Bluetooth asyncstreams change from prefix mode to non-prefix mode on the fly


Licensed User
Longtime User
I have customized hardware communicating with the Android application. This customized hardware interfaces with different types of serial sensors which sends data to the app. Till now I've been using the prefix mode of asyncstreams. But due to the uniqueness of a particular sensor in the way it expects data I cannot use prefix mode. So I want to change over from prefix mode to non-prefix mode and vice versa without disconnecting the bluetooth connection. When the bluetooth connects, I'm initializing the asyncstreams in prefix mode like earlier. Then in this special case, when the app requests this special sensor, I try to re-initialize the asyncstreams without prefix mode and then the app crashes. I there any way to achieve this? Alternative is to change everything to non-prefix mode, but that requires major makeover of the software which requires too much of efforts.