BLE Generic Access
BLE provides the Generic Access service, used to read characteristics and information from the Bluetooth device.
How To Connect
For information on how to connect to BLE devices, please see the BLE platform page.
How To Use
A short example of getting the device name from a BLE device:
var Cylon = require('cylon'); Cylon.robot({ connections: { bluetooth: { adaptor: 'ble', uuid: '207377654321' } }, devices: { generic: { driver: 'ble-generic-access' } }, display: function(err, data) { if (!!err) { console.log("Error: ", err); return; } console.log("Data: ", data); }, work: function(my) { my.generic.getDeviceName(my.display); } }).start();
Commands
getDeviceName
Gets the name of the BLE device
Params
-
callback (
Function
) to be triggered when data is read
Returns
- (
undefined
)
getAppearance
Gets the appearance descriptor of the BLE device
Params
-
callback (
Function
) to be triggered when data is read
Returns
- (
undefined
)