Code Monkey home page Code Monkey logo

lelo-f1-web-sdk's Introduction

LELO F1 SDK Web Bluetooth Client

WARNING: COMPATIBILITY WITH THE NEWER VERSION OF THE DEVICE (F1S V2) IS WORK IN PROGRESS. PLEASE REACH OUT IF YOU ARE AVAILABLE FOR BETA TESTING.

The original and official repository with sample code for Android and iOS as well as BLE specifications can be found at:

This is an unofficial vanilla JavaScript client based on the new Web Bluetooth API.

PLEASE NOTE: this project evolved into the newer and more powerful HUB prototype that you can check out on github.com/fabiofenoglio/lelo-f1-hub

WARNING: Work in progress! Currently developing on Chrome.

See the Simple working demo

See the AngularJS working demo

See the Mobile working demo

Available methods

All method return promises and can be chained.

  • requestDevice -> returns list of devices responding to filter (name equals 'F1s')
  • connect (device)
  • searchAndConnect (shortcut for requestDevice chained with connect)
  • disconnect
  • waitForAuthorization
  • isAuthorized -> returns boolean
  • getManufacturerName -> returns string
  • getFirmwareRevision -> returns string
  • getHardwareRevision -> returns string
  • getModelNumber -> returns string
  • getSoftwareRevision -> returns string
  • getBatteryLevel -> returns integer from 0 to 100
  • getKeyState -> returns boolean (F1s first version only)
  • getSecurityAccess -> returns 8 bytes (F1sV2 only)
  • getSecurityAccessConfirmed -> returns boolean (F1sV2 only)
  • getUseCount -> returns integer
  • resetUseCount
  • getButtonsStatus -> returns an object {plus: boolean, minus: boolean, central: boolean, any: boolean, none: boolean}
  • getMotorsSpeed -> returns array of integers [motorSpeed, vibeSpeed] from 0 to 100
  • getMainMotorSpeed -> returns integer from 0 to 100
  • getVibratorSpeed -> returns integer from 0 to 100
  • setMotorsSpeed (motorSpeed, vibeSpeed)
  • setMainMotorSpeed (motorSpeed)
  • setVibratorSpeed (vibeSpeed)
  • shutdownMotors
  • getTemperatureAndPressure -> returns array of floats [temperature in C, pressure in mBar]
  • getTemperature -> returns float in C
  • getPressure-> returns float in mBar
  • getAccelerometer -> returns array of integers [x, y, z]
  • getAccelerometerX -> returns integer
  • getAccelerometerY -> returns integer
  • getAccelerometerZ -> returns integer
  • getInsertionDepth -> returns integer from 0 to 8
  • getInsertionDepthPercentage -> returns integer from 0 to 100
  • getRotationSpeed -> returns integer in rpm
  • getWakeUp -> returns boolean (F1s first version only)
  • enableWakeUp (F1s first version only)
  • disableWakeUp (F1s first version only)
  • getCruiseControl -> returns boolean (F1s first version only)
  • enableCruiseControl (F1s first version only)
  • disableCruiseControl (F1s first version only)
  • getVibrationSettings -> returns array of integers [value0, value1, ... value7] (F1s first version only)
  • setVibrationSettings (value0, value1, ... value7) (F1s first version only)
  • notifyAccelerometer ( callback(value) ) -> returns handler
  • notifyButtons ( callback(value) ) -> returns handler
  • notifyInsertionDepth ( callback(value) ) -> returns handler
  • notifyInsertionDepthPercentage ( callback(value) ) -> returns handler
  • notifyKeyState ( callback(value) ) -> returns handler (F1s first version only)
  • notifySecurityAccess ( callback(value) ) -> returns handler (F1sV2 only)
  • notifyAuthorization ( callback(value) ) -> returns handler (both F1s and F1sV2)
  • notifyRotationSpeed ( callback(value) ) -> returns handler
  • notifyTemperatureAndPressure ( callback(value) ) -> returns handler
  • notifyTemperature ( callback(value) ) -> returns handler
  • notifyPressure ( callback(value) ) -> returns handler
  • unregister (handler)

lelo-f1-web-sdk's People

Contributors

fabiofenoglio avatar nicastel avatar ahezard avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.