Hello, everyone.
I'm using the example of the Nordic SDK(version 17), ble_app_uart.
I checked that strings are printed through the nRF Connect app.
And now I want to test it using App Inventor.
But the first step, Bluetooth connection, doesn't work. If you press the scan button and press the list button, nothing appears in the list.
Can I get a solution to this problem?
Thank you in advance.
First you have called "StartScanning", which will continue until you tell it to "StopScanning". So you'll have to add this instruction in your blocks.
As you've correctly done, you are placing your DeviceList in a list, but this only happens when there is something in the device list. This is not immediate.
So that is why this happens "and press the list button, nothing appears in the list."
The more common way of showing your device list is to use a "ListView" object where you simply add device list to this when they arrive via the "when DeviceFound" method is triggered. This will auto update on screen.
The alternative, if you want to do it your way, is to maybe only active the List button when DeviceFound is triggered or change button colour etc to indicate.
Then suggest add the stopscanning within the "AfterPicking" block.
Then, don't use a timer and the "ReadStrings" method. If you look at the nRFconnect picture you can see the "TX Characteristic" has a "NOTIFY" property. Thus use the "RegisterForStrings" method instead.
An event trigger will then occur if a string arrives via the "when StringsReceived" method. Use this to read your strings etc.