Hi,
I am trying to create and send bluetooth advertisements using the StartAdvertising API in the latest BLE extension (version 20200828). However, I don't see any advertisements from my device (Samsung Galaxy Note 5, Android 7.0). The app contains 2 blocks - one to start advertising and one to stop advertising. The start advertising block uses the following values:
inData: "Test"
serviceUuid: "45dfefc1-96d2-43ae-9466-91c5dcd557eb"
Confirmed that no errors are generated while running the app.
Installed a third party app, nRF Connect to send out custom advertisement and that works. So, the android version and the hardware of the device is capable of sending out custom advertisements.
I'm happy to wait.. just wanted to know if this was being looked at, solved, not on the table etc... this is the last piece of my app puzzle and without the ability to advertise, I am at a dead end.
I don't think that part of the extension has been looked at in quite some time. I can try to make some time to look at it tomorrow but I can't guarantee when we might have a fix available.
Here's a test version of the extension that should work with advertisements. Note that the Android BLE subsystem expects 16-bit UUIDs. I've also added some additional error messages that will get reported via the screen's ErrorOccurred event.
Thx Evan. With the test version, I was able start and stop the advertisements. I will test it with more devices. May be we will hear from others too...
Hi Evan. I also am able to advertise now. This lets me achieve what I set out to do. I appreciate you setting sometime aside to look at this. Without hijacking the original post, I noticed you can read Tx power but correct me if I'm wrong, there is currently no way to set the TX power?
My Slave device (HM-10) is set to 16-bit UUID (AAA0).
Running these blocks, AdvertiserServiceUuids return 128-bit (0000aaa0-0000-1000-8000-00805f9b34fb).
At this example I'm using as it's it, and getting null.
If I'm changing the AdvertisementData serviceUuid to use global variable with just 16-bit, AAA0, I'm getting "Invalid String"
I thought you were talking about creating advertisements on Inventor, not receiving them... (this post was about creating and advertising from your app)
The issue is that with the device name and a 128-bit UUID there isn't much if any room left in the advertising packet for data. You'll have better success if you use a 16-bit UUID. The Android docs also state that the UUID should be a 16-bit UUID.
You probably have both the old and new BLE extensions in your project. They use different names for various functions, and this disabling effect happens due to the collision where the functions are present in one but not the other and a conflict occurs. You'll need to take apart your project file, remove the older extension, and then reload the project in App Inventor.