Giter Club home page Giter Club logo

bt-common's Introduction

Low level Bluetooth support

Currently contains only GATT server implmenetation for ESP32.

Configuration section

bt-common library adds a bt configuration section with the following settings:

"bt": {
  "enable": true,             // Enabled by default. Disabled on first reboot with WiFi on
  "dev_name": "",             // Device name. If empty, value equals to device.id
  "adv_enable": true,         // Advertise our Bluetooth services
  "keep_enabled": true,       // Keep enabled after successful boot with WiFi on
  "scan_rsp_data_hex": "",    // Custom scan response data, as hex string (e.g. `48656c6c6f` for `Hello`)
  "allow_pairing": true,      // Allow pairingbonding with other devices
  "max_paired_devices": 10,   // Allow pairing with up to this many devices; -1 - no limit
  "gatts": {
    "min_sec_level": 0,       // Minimum security level for all attributes of all services.
                              // 0 - no auth required, 1 - auth reqd, 2 - auth + encryption reqd, 3 - auth + encryption + MITM reqd
    "require_pairing": false  // Require taht device is paired before accessing services
  }
}

Security

Default settings allow for unrestricted access: anyone can pair with a device and access the services. A better idea is to set bt.gatts.require_pairing to true, bt.allow_pairing to false and only enable it for a limited time via mgos_bt_gap_set_pairing_enable when user performs some action, e.g. presses a button. Raising bt.gatts.min_sec_level to at least 1 is also advisable. Note: At present, level 3 (MITM protection) is not usable as it requires device to have at least output capability during pairing, and there's no API for displaying the pairing code yet.

bt-common's People

Contributors

cpq avatar dimonomid avatar duncandrennan avatar iliapenev avatar qrpp avatar rojer 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.