iOS Question iBLE data?

f0raster0

Well-Known Member
Licensed User
Longtime User
Hello,
I'd like to extract data from a nRF using iBLE,
using the iBLE example I can connect and read from Bluetooth

Somebody knows how to get the data of:
-Heart rate measurement
-Battery level


Thanks

B4X:
Sub Manager_DataAvailable (Service As String, Characteristics As Map)
    ActivityIndicator2.Visible = False
  
   Dim bc As ByteConverter

      For Each id As String In Characteristics.Keys  
        Log($"** Reading Sens: ${id} **"$) 'list all Sens
        If id = "Battery Level" Then
            Log("val: "&Characteristics.Values)
                      
            Dim ArrayBytes () As Byte = Characteristics.Get(id)
            Log("Battery Level: "&ArrayBytes(0) & " %") 
           ' should be between 0 to 100
          
            Dim data1() As Byte = Characteristics.Get(0)          
            Log(bc.HexFromBytes(data1))   
            'reading exmple: '(emply string)
        End If

        If sensor = "2A37" Then 'Heart rate measurement
           
        End If      
    Next
End Sub
 
Last edited:

f0raster0

Well-Known Member
Licensed User
Longtime User
Edit: I think that I have solved the problem by following this and this b4a threads..
 
Last edited:
Upvote 0
Top