Bluetooth how to get Binary Data

Hello again friends,

It's just a question of curiosity.

How can get the binary value recived from a Bluetooth device?
Just interested what exact signal I get from devices like headphones, etc.

Thanks for your time.

Hi

I don't know of any Bluetooth devices that send binary values. Most common are Bytes, Integers and text (text as a 'code', either simple chars or Yaml).

There isn't really a standard that is adhered to either, even though BT and BLE are standards themselves. Headphones being an example - if lucky, the manufacturer will publish details of how to communicate with an App or supply an API for that purpose.

Bytes are decimal numbers you can use bit math blocks on.

2 Likes

Well... Bytes are binary...

A sample app for you

So I should use the ReceiveSignedBytes or the ReceiveUnsignedBytes?

Unsigned gets you 0-255, easier to work with.

1 Like

Not exactly, no. Have a read of Wikipedia.

Also, the AI2 binary data type is text, a fraud.

2 Likes

Maybe we are talking about two different things. The "Byte" I mean is the equal to 8 Bit. And as far as I know bits come from the binary system (0/1) used by every type of computer (except of "quantum computer"). If we are talking about two different things or if I learn smth wrong/miss understood you, please correct me.

Well, a binary digit is a single bit. A byte is 8 bits. However, as ABG points out, App Inventor actually uses text to represent binary.

Yes, nearly every type of computer works in binary, but that is not what we humans use to communicate with them, which is why you don't see a binary primitive in the types available. Have you actually got a device like headphones that requires communication in binary?

Well idk, thats what I' m trying to find out. Ik I could use google, but hey, why shouldn't I have a little bit fun and use ai2?

I thought devices like Bluetooth Headphones send a binary signal like if you press pause/skip/etc. bc the user doesn't need to read the signal, the mobile phone does everything.

Well, that could be inefficient in communication with another device, but the type used is determined by the manufacturer of the device and there are no standards that specify what that type should be, it's what the manufacturer thinks is best for the purposes of their device.