SL4A API asumes data been transfered in Bluetooth connections are encoded as
ASCII this lends to a loose of data, furthermore json isn't ready to encode
bytes ranging from 0 to 256 which would be the case for a binary stream.
This patch adds two functions bluetoothReadBinary and bluetoothWriteBinary
which will use base64 encoding to assure data is valid through the stream, is
the userspace application the one which needs to encode/decode base64.
bluetoothReadBinary will return a base64 encoded stream, while
bluetoothWriteBinary will require data to be transfered to be encoded into
base64 (no error handling is done in the write function...)
Base64 encoder/decoder is provided in the patch so that the code is compatible
with Android 1.6 (base64 is part of the API since 2.2)
This should fix issue 445 and 446.
Original issue reported on code.google.com by naranjo....@gmail.com on 5 Oct 2010 at 1:30
Original issue reported on code.google.com by
naranjo....@gmail.com
on 5 Oct 2010 at 1:30Attachments: