BluetoothLE extension 20200828 released

Hello everyone,

We have officially published BluetoothLE extension version 20200828. The API is 100% compatible with the 20200616 version that I previously made available, so any upgrade of the extension from that version should be smooth. In addition to the blocks, there is now a BLEExtension class that extension authors can use to make BLE-compatible extensions that should be forward compatible with future BLE versions.

Here is the change list:

  • Update extension permissions to be compatible with Android Q
  • Add new methods:
    • CanReadCharacteristic - Test whether the given ( serviceUuid , characteristicUuid ) is readable
    • CanRegisterForCharacteristic - Test whether the given ( serviceUuid , characteristicUuid ) can be used to register for notifications
    • CanWriteCharacteristic - Test whether the given ( serviceUuid , characteristicUuid ) is writable
    • CanWriteCharacteristicWithResponse - Test whether the given ( serviceUuid , characteristicUuid ) is writable with a response
  • Provide new BLEExtension class for extension developers to use

Regards,
Evan W. Patton, Ph.D.
Lead Software Engineer, MIT App Inventor

5 Likes

(added to FAQ)

(also added to)

The Doc link or contents do not reflect the new content
http://iot.appinventor.mit.edu/#/bluetoothle/bluetoothleintro

Could you be more specific about what isn't reflected? When I load the page I get:

and searching for the new method names brings you to the corresponding blocks.

I see this, even after doing a F5 refresh in my browser:

What if you try Shift+F5 or Ctrl+F5? I think it's just a caching issue but it's not clear how long your browser is caching it for (the server doesn't return caching headers for app.js file that drives the site).

Shift+F5 did it.

I'll have to remember that.
Thanks!

Any News on Write Bytes/Strings based on MTU Size?

Hello,

Could you, please, tell me how can I send and receive int32 data over BLE using this extension?
In fact, I want to sent the following sentence: 0FFFFFFF to one board with BLE; this question is related with this post: Sent data to Thunder Sense over BLE
Moreover, when I use "Register for Integers", then the application stop to display new arrived data over BLE.

Thank you,

Mihai

iBeacon extension - I'm adding a better description:
For iBeacon and other activities, please add one simple function to APP_Inventor BLEextension. I can't program it :frowning:

BLE Scan returns ScanResult, which contains ScanRecord:

public ScanResult (BluetoothDevice device,
int eventType,
int primaryPhy,
int secondaryPhy,
int advertisingSid,
int txPower,
int rssi,
int periodicAdvertisingInterval,
ScanRecord scanRecord,
long timestampNanos)

I need to return the getBytes () method from ScanResult.ScanRecord.getBytes ()
The input of the function will be DeviceAdress.

https://developer.android.com/reference/android/bluetooth/le/ScanRecord

Thank you very much