Bluetooth Low Energy (BLE) library

eshaulx

New Member
Licensed User
Longtime User
I want to write an array of bytes (values from 0x00 to 0xFF) to a characteristic. I can read an array of bytes easily enough using the Characteristic.GetValue method. However in the BLE Extended Library there is no Characteristic.SetValue method. There is only a Characteristic.SetString method and the string it creates contains extra bytes that is corrupting my data. Please help.
 

T0mee

Member
Licensed User
Longtime User
I am using a galaxy note 2 with android 4.3 and i can discover devices, connect to one and read a characteristic ...but how can i continous read ?

do i have to reconnect after a succesful BLE_CharacteristicRead ? Please help me i am stuck?!
 

Stulish

Active Member
Licensed User
Longtime User
Hi guys,

I just used the code from the first page and get the following error when compiling??

B4A line: 43
Dim s As BleService = Services.GetValueAt(0)
javac 1.7.0_21
src\lishsoft\android\BLE\main.java:313: error: cannot find symbol
_s.setObject((android.bluetooth.BluetoothGattService)(_services.GetValueAt((int) (0))));
^
symbol: class BluetoothGattService
location: package android.bluetooth
1 error

any ideas?
 

Chris Z

New Member
Licensed User
Longtime User
Hello All;
This is my first posting as a new member on these forums. Has anyone just acquired an advertising packet from their BLE device without doing any other connection? There is space in the advert for a minimal data payload that would be sufficient for some sensor types. This would seem to circumvent some of the issues with maintaining the connections. Thanks,
Chris Z
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
These are a couple of the strings I need to read. The UUID is "FFF2" , "FFF4", etc...

>>> NSString *simpleData2UUIDString = @"FFF2"; // Percent charged
>>> NSString *simpleData4UUIDString = @"FFF4"; // DSC

So, I believe I need to get the string at the UUID, just a bit unsure of how to do this.
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Yes, I get connected to the device. These are a few of the codes I need to read from the device...

"0000fff2-0000-1000-8000-00805f9b34fb"
"0000fff4-0000-1000-8000-00805f9b34fb"
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
B4X:
PackageAdded: package:solarble.com
** Activity (main) Create, isFirst = true **
Supported: true
** Activity (main) Resume **
Searching for devices
Sienu Power Monitor, 1C:BA:8C:26:96:8B
Discovering services.
CR: true: 00002a00-0000-1000-8000-00805f9b34fb
cr: Sienu Power Monitor

That's the log so far, it supports ble, it discovers and connects.

As far as reading variables from the device, is that something that is broadcasted from the device on an change event or is it something I poll using a timer. (I've got a timer service).
 
Last edited:
Top