Sub DataAvailable (Service As String, Characteristics As Map)
pbReadData.Visible = False
For i = 0 To Characteristics.Size - 1
For Each id As String In Characteristics.Keys
If id = "00002a1c-0000-1000-8000-00805f9b34fb" Then
Private tem As Int
Private temp1,temp2 As Float
Dim ArrayBytes() As Byte
ArrayBytes = Characteristics.Get("00002a1c-0000-1000-8000-00805f9b34fb") '<- ArrayBytes is EMPTY!!!!
tem = Bit.Or(Bit.And(Bit.ShiftLeft(ArrayBytes(1), 8), 0x0000ff00), Bit.And(ArrayBytes(0), 0x000000ff)) '<-ERROR
temp1 = (tem/65536)*165-40 ' = Grad
temp2 = ((temp1*9.0)/5.0)+32.0 ' = Fahrenheit
Log("Grad = " & NumberFormat(temp1, 1, 2))
Log("Fahrenheit = " & NumberFormat(temp2, 1, 2))
End If
Next
Next
End Sub