BluetoothLE1.ByteValueChanged returns an int8 ?

202 views
Skip to first unread message

Barry Parr

unread,
Nov 4, 2017, 5:03:17 PM11/4/17
to MIT App Inventor Forum
Hi Folks,
I'm a Total Noob with appinventor !
In an attempt to get communications between esp32 & android , I figured I would try bluetooth .
I have the the esp32 spitting out incrementing values .
actually , it's an array of 3  bytes .

void loop() {

  if (deviceConnected) {
    Serial.printf("*** Sent Value: %02x %02x %02x***\n", txValue[0],txValue[1],txValue[2]);
    pCharacteristic->setValue(&txValue[0], 3);
    pCharacteristic->notify();
    txValue[0]++;
    txValue[1]++;
    txValue[2]++;
  }
  delay(1000);
}

After Connecting & instigating the first (and only) ReadByteValue call ,
I start to receive updates with the ByteValueChanged .
How these updates are used has me somewhat confused .
1/ the result displayed in the 'byte_value' label is a signed int8 ?
I.E.  If the Value is above 127 , it is negative (129 displays  -127  etc)
2/ I am sending 3 bytes & when displayed in 'byte_value' label , they are joined together as one string . ?

I have a number of other questions regarding the BluetoothLE extension , but will address these later
Regards
Barry

gerrikoio

unread,
Nov 6, 2017, 7:50:33 AM11/6/17
to MIT App Inventor Forum
Based on the attached block diagrams, I believe you are using an old version of the BLE extension. 

If you click on the "Apps, Tips & Tricks" menu option, as shown in the MIT App Inventor forum, and open up the FAQ Part 1 link provided at the top of this page you will find a link to the latest Bluetooth LE extension (need to scroll down to find).

Barry Parr

unread,
Nov 6, 2017, 6:06:27 PM11/6/17
to MIT App Inventor Forum
Many thanks gerrikoio for pointing me in the right direction .
A total rework of code blocks req now to test it out.
This has no doubt been asked before ,
 but ,
how come the Help-Extension link in the builder still points to the old version ?
One could hardly call that help-ful
I thought it was a bit strange that there were only a few extensions available at that link.
-----------------------------------------------
I have just done a ggl & found this page https://puravidaapps.com/extensions.php
Very Clear & Very Helpful .
Perhaps help-extensions should point there .
Best Regards
Barry

Abraham Getzler

unread,
Nov 7, 2017, 9:22:07 AM11/7/17
to MIT App Inventor Forum
how come the Help-Extension link in the builder still points to the old version ?


Did some one silently fix that link, or is there yet a newer link
I am unaware of?

ABG
 

Evan Patton

unread,
Nov 7, 2017, 9:42:15 AM11/7/17
to MIT App Inventor Forum
Hi ABG,

That is the correct link. It was updated on August 17th to point to the updated BLE extension from the IOT launch. Maybe there was an issue with your machine caching the old version of page?

Regards,
Evan

Abraham Getzler

unread,
Nov 7, 2017, 10:39:55 AM11/7/17
to MIT App Inventor Forum
Maybe there was an issue with your machine caching the old version of page?

@Barry, do you have that obsolete link you complained of?

I don't see it as obsolete.

How about a screen print or the parent URL?

ABG
 

Barry Parr

unread,
Nov 7, 2017, 1:48:37 PM11/7/17
to MIT App Inventor Forum
Howdy all ,
I fear it was user error ...
when I first started using app inventor ,( 2nd/3rd  Nov ) I imported a project that included the old extension.
For whatever reason/s I didn't see I was using an outdated version .
I do apologize for any confusion I might have caused .
Regards
Barry

Abraham Getzler

unread,
Nov 7, 2017, 5:02:20 PM11/7/17
to MIT App Inventor Forum
@Barry, thanks for the clarification.
Let us know if you come across any obsolete materials that aren't posted with warning, okay?

ABG

Reply all
Reply to author
Forward
0 new messages