Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Cylon.js adaptor/drivers for Bluetooth LE

License

NotificationsYou must be signed in to change notification settings

hybridgroup/cylon-ble

Repository files navigation

Cylon.js (http://cylonjs.com) is a JavaScript framework for robotics, physical computing, and the Internet of Things using Node.js

This repository contains the Cylon adaptor/drivers to connect to Bluetooth Low Energy (LE) peripherals. It uses the Noble node module (https://github.com/sandeepmistry/noble) created by@sandeepmistry thank you!

For more information about Cylon, check out the repo athttps://github.com/hybridgroup/cylon

Build StatusCode ClimateTest Coverage

How to Install

Install the module with:

$ npm install cylon cylon-ble

For Ubuntu you must install the following dependency prior tonpm install cylon-ble:

$ sudo apt-get install libbluetooth-dev

How to Use

Here's a basic BLE example to get the battery level of a device:

"use strict";varCylon=require('cylon');Cylon.robot({connections:{bluetooth:{adaptor:'ble',uuid:'207377654321'}},devices:{battery:{driver:'ble-battery-service'}},work:function(my){my.battery.getBatteryLevel(function(err,data){if(!!err){console.log("Error: ",err);return;}console.log("Data: ",data);});}}).start();

How to Connect

varCylon=require('cylon');Cylon.robot({connections:{wiced:{adaptor:'ble',uuid:'207377654321'}},devices:{battery:{driver:'ble-battery-service'}},work:function(my){every((1).second(),function(){my.battery.getBatteryLevel(function(err,data){if(err){console.log(err);}else{console.log("BatteryLevel:",data);}});});}}).start();

You will need a computer with a hardware adaptor that supports Bluetooth LE, also known as Bluetooth 4.0, or Bluetooth Smart. Also, this module currently only supports OSX and Linux operating systems.

Commands

You can use thecylon-ble modules's included commands to scan for BLE devices, and then to list the various BLE characteristics for a specific device.

Note that you need to install cylon-ble using the-g option, and then run each commands undersudo like this:

$ sudo cylon-ble-scanStarting scan.Peripheral discovered!  Name: 2B-785E  UUID: cc360e85785e  rssi: -80$ sudo cylon-ble-info cc360e85785eperipheral with UUID cc360e85785e found  Local Name        = 2B-785E  TX Power Level    = -10  Service Data      =  Service UUIDs     = 22bb746f2ba075542d6f726568705327services and characteristics:1800 (Generic Access)  2a00 (Device Name)    properties  read, write    value       32422d37383545 | '2B-785E'...

Documentation

We're busy adding documentation to our web site athttp://cylonjs.com/ please check there as we continue to work on Cylon.js

Thank you!

Contributing

For our contribution guidelines, please go tohttps://github.com/hybridgroup/cylon/blob/master/CONTRIBUTING.md.

Release History

For the release history, please go tohttps://github.com/hybridgroup/cylon-gpio/blob/master/RELEASES.md.

License

Copyright (c) 2014-2016 The Hybrid Group. Licensed under the Apache 2.0 license.

About

Cylon.js adaptor/drivers for Bluetooth LE

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp