It is currently Tue Apr 25, 2017 7:30 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASIC! ?
Unread postPosted: Sat Dec 20, 2014 1:53 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
First I must admit that I'm a stupid boy :oops:

The story:
I'm curious.
I'm not an electronician.
I know coding our fabulous (!) BASIC!

One day I saw this little arm : Pocket sized robot arm V0.4
How to drive it only by coding with RFO-BASIC via Bluetooth (with no need to code a micro-controller: I'm not able to ! ) ?
I found this : Blue-Rx: A 16ch Servo / PWM Bluetooth 4.0 Receiver to purchase here Blue-Rx but don't buy it !!!!
My two devices have Bluetooth 4.0 (BLE)
I buy all this by saying to me "fun challenge !" :twisted: :? :x :mrgreen: :oops:

Unfortunately I don't saw this rfo-bro's post : http://rfobasic.freeforums.org/post13220.html?hilit=BLE%20scanner#p13220 before !!

BASIC! don't support BLE.
So I can discard the module Blue-Rx (not without trying with the precious help of brochi, thanks to him)

Later I found this : https://github.com/alt236/Bluetooth-LE-Library---Android

Please dear jMarc, I well know that you have no time but could you have a look ?
Maybe it could be easy for you to implement ? ( it's just a hope :D )

My other way ( another hope :oops: ) could be to find a nice electronician ( a know there are on this forum ;) ) able to create a Blue-Rx little board equivalent with Bluetooth classic based on HC05 Bt module, that can act when it receives formatted frames sent by BASIC!
Specifications: to drive at least 6 servos, and/or 2 RGB leds, and why not read some sensor like temperature or other ?
All this in the smallest space as possible and supplied by 5V.

I know I'm a dreamer, but if I don't ask :roll: :D

Merry Christmas to all.

Gilles.

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Last edited by Cassiope34 on Sat Dec 20, 2014 11:59 am, edited 3 times in total.

Report this post
Top
 Profile  
 
 Post subject: Re: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASI
Unread postPosted: Sat Dec 20, 2014 2:02 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
It is an interesting library, it can be compiled as a Jar and easily included in BASIC!
After, the hard work is to plug its APIs and implement the BASIC! keywords for them.
Also, I am not sure that the Apache Software License 2.0 is compatible with including this lib in our GPL BASIC! someone would have to investigate that.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASI
Unread postPosted: Sat Dec 20, 2014 2:52 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Hello Nicolas,

I don't know if it's a good or a bad news for me :twisted: :oops:

You think they are many many Keywords to add ?

Same than current BT commands + BLE.UUID... , BLE.Service... , BLE.Characteristics..., BLE.???

But I understand nothing in Java and other requirements ???

Cheers

Gilles.

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Report this post
Top
 Profile  
 
 Post subject: Re: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASI
Unread postPosted: Sat Dec 20, 2014 3:55 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
The list of keywords is linked to the list of APIs at https://github.com/alt236/Bluetooth-LE- ... ---Android
So yes, quite a while:
Quote:
Once you have created a device, you can access the following methods:

  • getAddress() : Gets the MAC Address of the device
  • getAdRecordStore(): Gives access to a device's Ad Records
  • getDevice(): Gives access to the standard BluetoothDevice object
  • getFirstRssi(): Retrieves the RSSI value which was used when the object was created
  • getFirstTimestamp() Retrieves the timestamp (in millis) which was used when the object was created
  • getRssi() Gets the current RSSI measurement (see note below).
  • getScanRecord() Retrieves the RAW scan record array
  • getTimestamp() Gets the timestamp of the last RSSI measurement
  • getRunningAverageRssi() Retrieves the internally calculated running average RSSI value

Accessing the Advertisment (Ad) Records
Once you have the AdRecordStore you can use the following methods:

  • getRecord(int recordNo): Gets the AdRecord object corresponding to the recordNumber.
  • getRecordDataAsString(int recordNo) : Gets the AdRecord contents as a String (expect non printable characters in most cases).
  • isRecordPresent(int recordNo): Checks to see if a record exists.

[I skip the iBeacon APIs, it appears to be an iOS technology]

You can also lookup values and convert them to human friendly strings:

  • BluetoothClassResolver.resolveDeviceClass(int btClass): Will try to resolve a Blueotooth Device class
  • CompanyIdentifierResolver.getCompanyName(int companyId, String fallback): Will try to resolve a Company identifier to the company name
  • GattAttributeResolver.getAttributeName(String uuid, String fallback): Will try to convert a UUID to its name.


Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASI
Unread postPosted: Sat Dec 20, 2014 5:42 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
I don't know if all of them are needed just to exchange simple (string$) datas (just to have the same behavior with BLE than BT classic) ?
To your mind what's RSSI ?

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Report this post
Top
 Profile  
 
 Post subject: Re: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASI
Unread postPosted: Sat Dec 20, 2014 11:38 am 
Offline

Joined: Wed Oct 03, 2012 9:53 am
Posts: 2795
Location: Colorado, U.S.
I have not looked at this at all, so I don't know how much work it would be to use this library.

However, the goal would be to make it look just like the existing BT command set. That is several commands, but they would all be in a group, so little impact on keyword search performance. Paul added the original BT by copying some Android demo code and modifying it; I think I made some changes, too, to make it work better in binary applications (like Arduino).

BT is rather a lot of code, using only the Android API for Bluetooth. Would the BLE library be easier than Android's BT? I don't know, but I will look at it.

- Marc


Report this post
Top
 Profile  
 
 Post subject: Re: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASI
Unread postPosted: Sat Dec 20, 2014 11:46 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
jMarc : you are my champion :D ;) and maybe my savior :lol:

I hope I hope Ihope :oops: ;)

Especially since I think that BLE is compatible with BT Classic.

Cheers

Gilles.

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Last edited by Cassiope34 on Mon Jan 12, 2015 11:46 pm, edited 1 time in total.

Report this post
Top
 Profile  
 
 Post subject: Re: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASI
Unread postPosted: Wed Dec 31, 2014 10:37 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Hello Marc,

I just find this : http://www.instructables.com/id/How-to-create-Android-BLE-application-faster-and-e/ with some very interesting links !

Hope it help :)

Happy new year :D :ugeek: :) :D

Gilles.

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Report this post
Top
 Profile  
 
 Post subject: Re: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASI
Unread postPosted: Wed Apr 22, 2015 1:52 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Hello Marc,

so sorry I prefectely know that you are VERY VERY busy by new versions and lot of requests by various peoples, but I would just know if I can always hope about BLE (Bluetooth Low Energy 4.0) management by RFO BASIC! ?

Bon courage,

Cheers

Gilles.

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Report this post
Top
 Profile  
 
 Post subject: Re: Bluetooth Low Energy (BLE)(BT 4.0) not supported by BASI
Unread postPosted: Mon Aug 22, 2016 5:58 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Hello Marc,

Please could you say me if I can still hope for BLE ?

It's because my Blue-Rx is still waiting for me ;) :)

Cheers

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred