Android Question [SOLVED]Write in 0x2902 BT characteristic

stefanoxjx

Active Member
Licensed User
Longtime User
Hi, I've a Cypress Bluetooth module and I need to receive and send data to this by serial service.
I've downloaded the Bluetooth example from here: https://www.b4x.com/android/forum/threads/android-bluetooth-bluetoothadmin-tutorial.14768/
I can connect to module, but can't send data.
Through LightBlue App I can send data without problems, to 0x2902 characteristic.
I don't undestand how I can modify to Bluetooth example to send data in this characteristic.
Can you help me?
Thanks.
Regards.
 

emexes

Expert
Licensed User
Hi, I send to service 65333333-a115-11e2-9e9a-0800200ca100 and characteristics:
65333333-a115-11e2-9e9a-0800200ca101
65333333-a115-11e2-9e9a-0800200ca102
You write to both of them? Do they do different things? Or do the same thing?

What do they do, as in: how do you know the string has been received by the BLE device? Does it, say, turn a LED on?

If we had to choose which one to get working first, *101 or *102, which one would we do?
 
Upvote 0

stefanoxjx

Active Member
Licensed User
Longtime User
You write to both of them? Do they do different things? Or do the same thing?
For me they do same things.
*101 = Writable, indicate
*102 = Writable without response, Notify
*103 = Indicate

What do they do, as in: how do you know the string has been received by the BLE device? Does it, say, turn a LED on?
I can see a rx buffer of device and when I send data with LightBlue, I see in buffer same data transmitted.

If we had to choose which one to get working first, *101 or *102, which one would we do?
At the moment, *101 or *102 is indifferent.

In LightBlue, I can send data only if I tap to "Subscribe" button, otherwise it tell me "Data sent" but I don't receive any.
For me, this should not crashes the b4a program.
In doubt I ask you if is there perhaps a subscription function?

Thanks.
 
Upvote 0

stefanoxjx

Active Member
Licensed User
Longtime User
I probably took a small step forward.
Now when I send data the app don't crash, but I can't receive data.
Through "BLE Scanner" app, I've seen that I can receive data only if I enable flag "Indicate".
Can you tell me if exist a funcion to call to enable it?
Thaks.
 
Upvote 0

emexes

Expert
Licensed User
Through "BLE Scanner" app, I've seen that I can receive data only if I enable flag "Indicate".
Can you tell me if exist a funcion to call to enable it?
?

1596206997269.png


1596207054350.png
 
Last edited:
Upvote 0
Top