Hello,
ive wrote an App with B4A wich works perfect.
now i want to do the same with B4i.
I run B4i 3.5 with iBLE 2.00.
First i call ReadData and wait for DataAvailable.
Then i set a notify for a characteristic:
After that i start a timer wich sends a special string to the device every 5 seconds
If the device recieve the String it will send back a bytearray.
Then the DataAvailable raise again because of the notify.
in B4i i get all characteristics instead of the single one i have set the notify to.
so now i want to read the bytearray in one characteristic:
But the Characteristic is always NULL
This are all Characteristics and i want to read from [9] 49535343-1E4D-4BD9-BA61-23C647249616
What is the problem? Can somebody help me?
thanks!
ive wrote an App with B4A wich works perfect.
now i want to do the same with B4i.
I run B4i 3.5 with iBLE 2.00.
First i call ReadData and wait for DataAvailable.
Then i set a notify for a characteristic:
B4X:
manager.SetNotify("49535343-FE7D-4AE5-8FA9-9FAFD205E455","49535343-1E4D-4BD9-BA61-23C647249616",True)
After that i start a timer wich sends a special string to the device every 5 seconds
B4X:
Dim s As String = "PCD-2 BLE"
Main.manager.WriteData("49535343-FE7D-4AE5-8FA9-9FAFD205E455","49535343-8841-43F4-A8D4-ECBE34729BB3",s.GetBytes("UTF8"))
If the device recieve the String it will send back a bytearray.
Then the DataAvailable raise again because of the notify.
in B4i i get all characteristics instead of the single one i have set the notify to.
so now i want to read the bytearray in one characteristic:
B4X:
Sub DataAvailable (Service As String, Characteristics As Map)
recievedData=True
getPCDValues(Characteristics.Get(2))
hd.ProgressDialogHide
End Sub
But the Characteristic is always NULL
This are all Characteristics and i want to read from [9] 49535343-1E4D-4BD9-BA61-23C647249616
B4X:
Notification state changed for characteristic: 49535343-1E4D-4BD9-BA61-23C647249616
NSMapTable {
[1] 49535343-ACA3-481C-91EC-D85E28A60318 -> <B4IArray: 0x15dcfad0>
[7] 49535343-6DAA-4D02-ABF6-19569ACA69FE -> <B4IArray: 0x15dd7530>
[9] 49535343-1E4D-4BD9-BA61-23C647249616 -> <B4IArray: 0x15dcd1e0>
[10] 49535343-8841-43F4-A8D4-ECBE34729BB3 -> <B4IArray: 0x15dd0920>
[12] 49535343-026E-3A9B-954C-97DAEF17E26E -> <B4IArray: 0x15dd9eb0>
}
What is the problem? Can somebody help me?
thanks!