douglasjunior / AndroidBluetoothLibrary

A Library for easy implementation of Serial Bluetooth Classic and Low Energy on Android. 💙
MIT License
224 stars 68 forks source link

trying to send bytes, but always receiving ascii chars #46

Closed MansourM closed 1 year ago

MansourM commented 2 years ago

Hi Thank you for your great work on the AndroidBluetoothLibrary, made the work easy and reliable for some one new to BT connections like me. I'm moving to a bit more advanced stuff and encountered a problem, I'm working on the app side while somebody else is doing the hardware part (SPP-C). the problem is when he is trying to send anything like a byte that gets translated to 127 (11111111) which is a single bye on his side, it gets translated to ascii code counter parts on my side, in our example 127 becomes 49 (1) 50 (2) 7(55). (so i receive 3 bytes of ascii code instead of 1 byte of data equal to 127).

we tried several methods like sending as hex and other stuff but all had the same result for example for 0xAA I receive 65(A) 65(A).

I wanted to know if this problem is because of bluetooth protocol, library or maybe and error on our part.

thanks a lot