Methods

public

barometerCallback(fun, interval)

Both CC2541 and CC2650. Public. Set the barometer notification callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

barometer rate in milliseconds.

public

barometerOff()

Both CC2541 and CC2650. Public. Turn off barometer notification.

public

barometerOn()

Public. Turn on barometer notification.

public

connectToClosestDevice()

Public. Connect to the nearest physical SensorTag device.

Deprecated
Use evothings.tiseonsortag.ble.connectToNearestDevice
public

connectToDevice(device)

Connect to a SensorTag BLE device.

Parameter

Name Type Optional Description

device

 

 

A Bluetooth Low Energy device object.

public

connectToNearestDevice(scanTimeMilliseconds)

Public. Connect to the nearest physical SensorTag device. For this to work reliably SensorTags should be at least a couple of meters apart.

Parameter

Name Type Optional Description

scanTimeMilliseconds

 

 

The time to scan for nearby SensorTags (optional, defaults to 3 seconds).

public

deviceIsSensorTag()

Determine if a BLE device is a SensorTag. This version checks the general case using the advertised name. Specific versions for CC2541 and CC2650 uses advertisement data to determine tag type.

public

disconnectDevice()

Public. Disconnect from the physical device.

public

getHumidityValues(data)

Calculate humidity values from raw data.

Parameter

Name Type Optional Description

data

 

 

an Uint8Array.

Returns

Object with fields: humidityTemperature, relativeHumidity.

public

humidityCallback(fun, interval)

Both CC2541 and CC2650. Public. Set the humidity notification callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

humidity rate in milliseconds.

public

humidityOff()

Both CC2541 and CC2650. Public. Turn off humidity notification.

public

humidityOn()

Both CC2541 and CC2650. Public. Turn on humidity notification.

public

keypressCallback(fun)

Both CC2541 and CC2650. Public. Set the keypress notification callback.

Parameter

Name Type Optional Description

fun

 

 

success callback called when a key is pressed: fun(data)

public

keypressOff()

Both CC2541 and CC2650. Public. Turn off keypress notification.

public

keypressOn()

Both CC2541 and CC2650. Public. Turn on keypress notification.

public

sensorOff()

Helper function for turning off sensor notification.

public

sensorOn()

Public. Used internally as a helper function for turning on sensor notification. You can call this function from the application to enable sensors using custom parameters. For advanced use.

public

startScanningForDevices(foundCallback)

Start scanning for physical devices.

Parameter

Name Type Optional Description

foundCallback

 

 

Function called when a SensorTag is found. It has the form foundCallback(device) where is a an object representing a BLE device object. You can inspect the device fields to determine properties such as RSSI, name etc. You can call deviceIsSensorTag(device) to determine if this is a SensorTag of the same type as the instance object. To connect to a SensorTag call connectToDevice(device).

public

stopScanningForDevices()

Stop scanning for physical devices.

public

temperatureCallback(fun, interval)

Both CC2541 and CC2650. Public. Set the humidity temperature callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

humidity rate in milliseconds.

public

temperatureOff()

Both CC2541 and CC2650. Public. Turn off IR temperature notification.

public

temperatureOn()

Both CC2541 and CC2650. Public. Turn on IR temperature notification.