Android Question Struggling to understand BLE2.

Steve-h

Member
I am trying to use BLE2 to send and receive 8 characters as a string every 250ms. Android one end and RN4870 ble module the other. The Module has a GATT “Transparent UART” service.

Have the BLEExample which connects to the module and reports the module name. The Read Data button reports some numbers I don't understand That is as far as I can get.

Members ReadData2 and WriteData require Service and Characteristic strings but I don't understand what they are and whatever I try seems to cause a syntax error.

Been reading the various BLE topics on the forum but my understanding of BLE is so limited they have not helped so far.

Been staring at this for a few days now.

Is there a tutorial or guide to help me which assumes I know nothing ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Steve-h

Member
My inability to understand this is frustrating. Have read and re read https://atadiat.com/en/e-bluetooth-low-energy-ble-101-tutorial-intensive-introduction/ a few times but still none the wiser.

Normally I can figure out something eventually if I have some working code to unpick. The BLEExample establishes a connection but it is not clear how to actually send and receive data other than details of the module. With RS232 I get an interrupt and go to retrieve the data. Is there a comparable event with BLE ?

With the module configured to be “uart transparent” The read data button reports Microchip, RN487x, 0000, 5505 102_BLDK3, 01040101, 1.18. Do one of these represent the service or the characteristic ? Plainly Microchip is the manufacturer, RN487x the model and 1.18 the version.

In an attempt to achieve something I note BLE2 has a member ReadRemoteRssi but how do I access the Rssi

adding

B4X:
Private Sub Butrssi_Click
    manager.ReadRemoteRssi
    Log("RSSI")
End Sub

Sub RssiAvilible(Succsess As Boolean,Rssi As Double)
    If Succsess=True Then Log("sucsess")
    Log(Rssi)
End Sub

Reports that RssiAvialable is not used

To get data transferred is it just a case of calling ReadData and WriteData and then retrieve the data from a DataAvialable event ?

Please someone must have a simple working example
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
My inability to understand this is frustrating. Have read and re read https://atadiat.com/en/e-bluetooth-low-energy-ble-101-tutorial-intensive-introduction/ a few times but still none the wiser.

Normally I can figure out something eventually if I have some working code to unpick. The BLEExample establishes a connection but it is not clear how to actually send and receive data other than details of the module. With RS232 I get an interrupt and go to retrieve the data. Is there a comparable event with BLE ?

With the module configured to be “uart transparent” The read data button reports Microchip, RN487x, 0000, 5505 102_BLDK3, 01040101, 1.18. Do one of these represent the service or the characteristic ? Plainly Microchip is the manufacturer, RN487x the model and 1.18 the version.

In an attempt to achieve something I note BLE2 has a member ReadRemoteRssi but how do I access the Rssi

adding

B4X:
Private Sub Butrssi_Click
    manager.ReadRemoteRssi
    Log("RSSI")
End Sub

Sub RssiAvilible(Succsess As Boolean,Rssi As Double)
    If Succsess=True Then Log("sucsess")
    Log(Rssi)
End Sub

Reports that RssiAvialable is not used

To get data transferred is it just a case of calling ReadData and WriteData and then retrieve the data from a DataAvialable event ?

Please someone must have a simple working example
first step.. download the App of Microchip (if using RN487, also you can use the App nRF Connect from Semiconductor) using any of that app you will see the UUID etc and you can test your hardware,

next: then try to make the connection between ypur module and the demo below, and try to read basic information

after that I think you could ask your next question
 
Last edited:
Upvote 0
Top