bluetooth.* — Bluetooth


Type Library


Overview

The Bluetooth plugin enables Bluetooth communication.

Notes
  • This plugin is currently in beta. APIs and project configuration are subject to change without notice during this time.

  • This plugin is currently only available for Android, but iOS support is in development.

Syntax

local bluetooth = require( "plugin.bluetooth" )

Properties

bluetooth.isActive

bluetooth.isScanning

bluetooth.isMultipleAdvertisementSupported

bluetooth.isOffloadedFilteringSupported

bluetooth.isOffloadedScanBatchingSupported

Functions

bluetooth.init()

bluetooth.setName()

bluetooth.startScan()

bluetooth.stopScan()

bluetooth.connect()

bluetooth.disconnect()

bluetooth.newServer()

bluetooth.startAdvertising()

bluetooth.stopAdvertising()

Events

advertising

init

scan

Types

Gatt

Characteristic

Descriptor

Server

Service

Project Settings

To use this plugin, add an entry into the plugins table of build.settings. When added, the build server will integrate the plugin during the build phase.

settings = {
    plugins = {
        ["plugin.bluetooth"] = {
            publisherId = "com.spiralcodestudio",
            supportedPlatforms = { android = true }
        }
    }
}

Sample Project

A sample project can be found here.

https://github.com/Lerg/plugins-sample-bluetooth