I am planning a communication protocol to be used between an Android device and a custom sensor that would use a commercial Bluetooth module. I would use the SPP profile that is said to "provide a simple reliable data stream to the user, similar to TCP."
I am not so familiar with the Bluetooth technology and have some questions about designing such a protocol.
First of all it is not clear to me if I have to worry corrupted data being transferred or not. Will the underlying protocoll stack guarantee me that the bytes I read from the InputStream
Android gives are the same that the UART receives on the sensor side? Do I have to define my own data packages protected with CRC or stuff or would it be overkill?
It is not clear to me from the Android Bluetooth documentation what happens in my application if the signal is weak and is lost for a while. Do I get IOException
at once or the platform provides me some hidden error handling and recovery that would make such short outages invisible to me?
Thanks for any advice.