Functions

init()

Overview

Initialize the plugin with a listener.

Syntax

local function Listener(event)
    print(event.type)
end
bonbonbearThermometer.init(Listener)

Listener (required)

Function. Callback function to receive event results. Refer to the Events page for possible callbacks.

startScanning()

Overview

Start scanning for availible thermometers. On android the scan automatically spots after a few seconds, so you must call this whenever you want to refresh availible devices.

Syntax

bonbonbearThermometer.startScanning()

stopScanning()

Overview

Stop scanning for availible thermometers.

Syntax

bonbonbearThermometer.stopScanning()

connect()

Overview

Connect to a found peripheral. Must pass the address of the peripheral.

Syntax

bonbonbearThermometer.connect(peripheral.address)

peripheral.address (required)

String. The address of the peripheral to which you want to connect.

stopGetTemperature()

Overview

Disconnect from peripheral and stop receiving temperature.

Syntax

bonbonbearThermometer.stopGetTemperature()

getTheQRCodeOfPeripheral()

Overview

Get the QR Code of a specified peripheral. Only availible on iOS

Syntax

bonbonbearThermometer.getTheQRCodeOfPeripheral(peripheral.address)

param1 (required)

String. The address of the peripheral to which you want to connect.