Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Bleat (Blutooth Low Energy Abstraction Tool) provides a simplified BLE layer which uses adapters to abstract the usage of BLE in JavaScript on different platforms.
Central Mode
Central Adapters
Central Adapters
Peripheral Mode
Peripheral Adapters
npm install bleat
-or-
bower install bleat
The main bleat.core.js
file offers the BLE layer while each bleat.<platform>.js
file represents an adapter.
The bleat.js
file contains the BLE layer and all adapters concatenated together (not minified).
The bleat.min.js
file is a minified version of the BLE layer and all adapters.
Files follow the UMD (https://github.com/umdjs/umd), so should work with AMD (requirejs), CommonJS (node) and plain JavaScript projects.
Refer to the example_<adapter>
files for simple examples.
Include (or require) the bleat.core.js
file before the adapter you wish to use or include the minified file offering all adapters.
e.g.
<script src="path/to/bleat.core.js"></script>
<script src="path/to/bleat.<adapter>.js"></script>
-or-
<script src="path/to/bleat.min.js"></script>
Simply require it up!
var bleat = require('bleat');
Initialise bleat.
void bleat.init([readyFn], [errorFn], [adapterName]);
function readyFn(): callback function once init has completed
function errorFn(message): callback function for all errors while bleating
string adapterName: when multiple adapters available, specify which to use
Start scanning for devices.
void bleat.startScan(foundFn);
function foundFn(device): callback function for each device discovered.
Stop scanning for devices.
void bleat.stopScan();
string device.address: uuid of device
string device.name: name of device
bool device.connected: whether device is connected
string array device.serviceUUIDs: array of advertised services
object services: map of device services keyed on service uuid (available once connected)
Returns whether a device has the specified service.
bool device.hasService(serviceUUID);
string serviceUUID: service to search for
Connect to the device.
void device.connect(connectFn, [disconnectFn], [suppressDiscovery]);
function connectFn(): callback once connected
function disconnectFn(): callback when disconnected
bool suppressDiscovery: don't undertake automatic discovery of services, characteristics and descriptors
Disconnect from device.
void device.disconnect();
Discover all services for this device
void device.discoverServices(callbackFn)
function callbackFn(): callback once discovery complete
Discover all services, characteristics and descriptors for this device
void device.discoverAll(callbackFn)
function callbackFn(): callback once discovery complete
string uuid: uuid of service
bool primary: whether service is primary or not
object characteristics: map of service characteristics keyed on characteristic uuid
Discover all characteristics for this service
void service.discoverCharacteristics(callbackFn)
function callbackFn(): callback once discovery complete
string uuid: uuid of characteristic
string array properties: characteristic properties
object descriptors: map of characteristic descriptors keyed on descriptor uuid
Read value of characteristic.
void characteristic.read(completeFn);
function completeFn(ArrayBuffer): callback function containing value
Write value to characteristic.
void characteristic.write(bufferView, completeFn);
DataView bufferView: value to write
function completeFn(): callback function once completed
Enable notifications when characteristic value changes.
void characteristic.enableNotify(notifyFn, completeFn);
function notifyFn(ArrayBuffer): callback function containing value when changes
function completeFn(): callback function once completed
Disable characteristic notifications.
void characteristic.disableNotify(completeFn);
function completeFn(): callback function once completed
Discover all descriptors for this characteristic
void characteristic.discoverDescriptors(callbackFn)
function callbackFn(): callback once discovery complete
string uuid: uuid of descriptor
Read value of descriptor.
void descriptor.read(completeFn);
function completeFn(ArrayBuffer): callback function containing value
Write value to descriptor.
void descriptor.write(bufferView, completeFn);
DataView bufferView: value to write function completeFn(): callback function once completed
FAQs
Abstraction library following Web Bluetooth specification for hiding differences in JavaScript BLE APIs
The npm package bleat receives a total of 1 weekly downloads. As such, bleat popularity was classified as not popular.
We found that bleat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.