BLE SCAN question.

Ask, and ye shall receive.
evanou
Posts: 1
Joined: 21:53, 15 Jul 2015

BLE SCAN question.

Postby evanou » 22:18, 15 Jul 2015

I haven't used Java since I left school 15 years ago, can some one please point me to the right direction.

Here is a snippet of code from app.js of BLE SCAN. I programmed some random payload bytes to the BLE device, and I was able to read the RSSI and device name, is there a way to read the payload.

Where can I find the data structure of "device", there is device.name, device.rssi and device.address, maybe there is a device.payload?

Thanks for your help.

$.each(app.devices, function(key, device)
{
// Only show devices that are updated during the last 10 seconds.
if (device.timeStamp + 10000 > timeNow)
{
// Map the RSSI value to a width in percent for the indicator.
var rssiWidth = 1; // Used when RSSI is zero or greater.
if (device.rssi < -100) { rssiWidth = 100; }
else if (device.rssi < 0) { rssiWidth = 100 + device.rssi; }

// Create tag for device data.
var element = $(
'<li>'
+ '<strong>' + device.name + '</strong><br />'
// Do not show address on iOS since it can be confused
// with an iBeacon UUID.
+ (evothings.os.isIOS() ? '' : device.address + '<br />')
+ device.rssi + '<br />'
+ '<div style="background:rgb(225,0,0);height:20px;width:'
+ rssiWidth + '%;"></div>'
+ '</li>'
);

$('#found-devices').append(element);
}
});

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: BLE SCAN question.

Postby Fredrik » 15:17, 21 Jul 2015

Suggest you look at the BLE plugin documentation, section "DeviceInfo". The fields "scanRecord" and "advertisementData" may be what you seek.


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 13 guests