B4A Library BLE 2 - Bluetooth Low Energy

Status
Not open for further replies.

stari

Active Member
Licensed User
Now I can solve my problem by using BLE2 instead of BluetoothAdmin to scan BLE device. And use BleExtEx to send/read data to/from BLE device (HM-10). Data that I mentioned here is the same serial data that we send using Serial library with Bluetooth 2 device (HC-05).

However, I want to know if BLE2 can do the same (send/read data to/from HM-10 with TxD/RxD pin) with BLE device as Serial do with BT2 device or not ? With BleExtEx, we can do but with limited byte per frame (maybe 20 byte max).
Hi,
i also work with HM-10 and i can send/receive data. On other side i have connected PIC P18F45K22 and also without any problem.
I'ts true, 24 bytes per frame is max.
 

KY Leng

Member
Licensed User
Hi,
i also work with HM-10 and i can send/receive data. On other side i have connected PIC P18F45K22 and also without any problem.
I'ts true, 24 bytes per frame is max.
Good to hear that you can do it.
However, could you please share some piece of code to read/send 24 byte data to PIC ?
Thank you in advance.
 

stari

Active Member
Licensed User
Good to hear that you can do it.
However, could you please share some piece of code to read/send 24 byte data to PIC ?
Thank you in advance.
Hi, yes i can. This is taken from another sample here on B4A communitty. I'ts only a working example, but i think i'ts Ok.
Example is for HM-10 module (BLE). At the end i send "*", because HM-10 don't send any terminating character.
 

Attachments

KY Leng

Member
Licensed User
Hi, yes i can. This is taken from another sample here on B4A communitty. I'ts only a working example, but i think i'ts Ok.
Example is for HM-10 module (BLE). At the end i send "*", because HM-10 don't send any terminating character.
Thank you very much stari,
I will check it...
Best regards,
 

appie21

Active Member
Licensed User
Hello

is BLE2 same as Bluetooth 4.0?

Fir example if a headset support Bluetooth 4.0 I can work with this library
 

stari

Active Member
Licensed User
Hello

is BLE2 same as Bluetooth 4.0?

Fir example if a headset support Bluetooth 4.0 I can work with this library
The HM-10 is a readily available Bluetooth 4.0 module based on the Texas Instruments
CC2540 or CC2541 Bluetooth low energy (BLE) System on Chip (SoC).
I work with this module without problems.
 

appie21

Active Member
Licensed User
The HM-10 is a readily available Bluetooth 4.0 module based on the Texas Instruments
CC2540 or CC2541 Bluetooth low energy (BLE) System on Chip (SoC).
I work with this module without problems.
Hij

Thank you

I looking for a good headset
 

postasat

Member
Licensed User
Hi,
is it possible to connect to two or more of the same type of devices and read (with SetNotify) all of data and after that, assigning every data received at the right devices ?
(How to know who is sending the data)

Thanks.
 

Erel

Administrator
Staff member
Licensed User

ncabilis

Member
Licensed User
Hello.
Is it possible to get rssi value after bluetooth ble connected?
Thanks
 
Last edited:

ncabilis

Member
Licensed User
Thanks for your answer. I found a similar solution in BleExt library using the Manager.StartRssiTracking routine.
 

mczubel

Member
Licensed User
Good to hear that you can do it.
However, could you please share some piece of code to read/send 24 byte data to PIC ?
Thank you in advance.
Hi
I need to send AT commands to HM-10, this will be used as beacon and need write and rewrite
AT+IBE094900001

AT+IBE100374360
It is possible with ble2 or BLEext?
1000 thanks
 

ncabilis

Member
Licensed User
Hi
I need to send AT commands to HM-10, this will be used as beacon and need write and rewrite
AT+IBE094900001

AT+IBE100374360
It is possible with ble2 or BLEext?
1000 thanks
Assuming that you are using Arduino: From B4A, using BLEEXT, you can send a string to Arduino HM-10 BT.
Sub Button1_Click
Dim HMString As String
HMString = "1" & CRLF ' 20 characters max
If ConnectState = cstateConnect Then
Log("Write -> " & HMString)
writeCharacteristic.SetStringValue(HMString)
Manager.WriteCharacteristic(writeCharacteristic)
End If
End Sub

Now, on the Arduino side, you can read this character and to send the command: bluetooth.write('AT+IBE094900001');

#include <SoftwareSerial.h>

SoftwareSerial bluetooth(5, 6); // RX, TX
int info;
void setup()
{
Serial.begin(9600);
bluetooth.begin(9600);
}

void loop()
{
if (bluetooth.available()>0)
{
info = bluetooth.read();
if (info=='1') //READ STRING FROM B4A
{
bluetooth.write('AT+IBE094900001');
}

} //bt available
} //loop

If you have trouble, I can send you a general code in both languages (Arduino C, B4A)
 
Last edited:
Status
Not open for further replies.
Top