Hi, folks. Please help me with your wisdom
I developed years ago an App to work with the button of iTAG, but apparently, something is different with the new iTags.
For troubleshooting, I used the nRF Connect App. and I noticed I need to send a command or similar to the iTAG to enable the feature of the button. my old iTAGs work without need to write or send something to them. But these new ones are weirds.
the New iTAG and nRF Connect. The new iTAG is connected
Take a look at "Notification and Indication disable"
if I press the button in the iTAG the nRF does not detect it.
So, to put to work the button of the iTAG I did this:
Pressed the button (I showed in blue circle).
and look now the value to "Notification Enable"
So, Now when I press the iTAG button the nRF connect App receive the value take a look the green circle the value is correct (0x)01 exactly the same with my old iTAGs
My understanding, apparently, I need now with those new iTags send a manager.write or manager.notify to enable or turn on the flag indicating the iTAG to send the value 0x01 ??? with the old iTAG I only need read never send a command.
Where
Dim findmeCharacteristic As String = "0000ffe1-0000-1000-8000-00805f9b34fb"
Dim findmeService As String = "0000ffe0-0000-1000-8000-00805f9b34fb"
That code works great with my old iTags, but give this error with the new ones.
Found: ITAG, FC:58:FA:04:03B, RSSI = -64, (MyMap) {1=[B@424587b, 10=[B@915698, 2=[B@7d45ef1, 9=[B@9c00ad6, 0=[B@1960157}
ITAG ENCONTRADO
Discovering services.
Discovering services.
Discovering services.
id =00002a05-0000-1000-8000-00805f9b34fbCaracteristica =[B@cd395c8
id =00002a06-0000-1000-8000-00805f9b34fbCaracteristica =[B@e69e661
id =0000ffe1-0000-1000-8000-00805f9b34fbCaracteristica =[B@74ed586
nucleo_manager_dataavailable (B4A line: 207)
BotoniTAGapretado = data(0) '1 = Button Pressed
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at cpn.dgcop.nucleo5._manager_dataavailable(nucleo5.java:344)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7045)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
The problematic code is this:
BotoniTAGapretado = data(0) '1 = Button Pressed 0 = No button pressed
I am thinking, I am close to the solution but
Thanks for any light.
Daniel W
I developed years ago an App to work with the button of iTAG, but apparently, something is different with the new iTags.
For troubleshooting, I used the nRF Connect App. and I noticed I need to send a command or similar to the iTAG to enable the feature of the button. my old iTAGs work without need to write or send something to them. But these new ones are weirds.
the New iTAG and nRF Connect. The new iTAG is connected
Take a look at "Notification and Indication disable"
if I press the button in the iTAG the nRF does not detect it.
So, to put to work the button of the iTAG I did this:
Pressed the button (I showed in blue circle).
and look now the value to "Notification Enable"
So, Now when I press the iTAG button the nRF connect App receive the value take a look the green circle the value is correct (0x)01 exactly the same with my old iTAGs
My understanding, apparently, I need now with those new iTags send a manager.write or manager.notify to enable or turn on the flag indicating the iTAG to send the value 0x01 ??? with the old iTAG I only need read never send a command.
B4X:
Sub Manager_DataAvailable (ServiceId As String, Characteristics As Map)
'iTags only
Dim Valread As String = ""
For Each id As String In Characteristics.Keys
Dim data() As Byte
data = Characteristics.Get(id)
Valread = BytesToString(data, 0, data.Length, "UTF8")
Select id
Case findmeCharacteristic 'FIND_ME_CHARACTERISTIC
BotoniTAGapretado = data(0) '1 = Button Pressed 0 = No button pressed.
Where
Dim findmeCharacteristic As String = "0000ffe1-0000-1000-8000-00805f9b34fb"
Dim findmeService As String = "0000ffe0-0000-1000-8000-00805f9b34fb"
That code works great with my old iTags, but give this error with the new ones.
Found: ITAG, FC:58:FA:04:03B, RSSI = -64, (MyMap) {1=[B@424587b, 10=[B@915698, 2=[B@7d45ef1, 9=[B@9c00ad6, 0=[B@1960157}
ITAG ENCONTRADO
Discovering services.
Discovering services.
Discovering services.
id =00002a05-0000-1000-8000-00805f9b34fbCaracteristica =[B@cd395c8
id =00002a06-0000-1000-8000-00805f9b34fbCaracteristica =[B@e69e661
id =0000ffe1-0000-1000-8000-00805f9b34fbCaracteristica =[B@74ed586
nucleo_manager_dataavailable (B4A line: 207)
BotoniTAGapretado = data(0) '1 = Button Pressed
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at cpn.dgcop.nucleo5._manager_dataavailable(nucleo5.java:344)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7045)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
The problematic code is this:
BotoniTAGapretado = data(0) '1 = Button Pressed 0 = No button pressed
I am thinking, I am close to the solution but
Thanks for any light.
Daniel W
Last edited: