Class: $.DeviceDataModel

Inherits:
Toybox.Lang.Object show all

Overview

Instance Member Summary collapse

Instance Method Summary collapse

Instance Attribute Details

var _dataModelFactory as $.DataModelFactory

var _device as BluetoothLowEnergy.Device or Null

var _environmentProfile as $.EnvironmentProfileModel or Null

var _scanResult as BluetoothLowEnergy.ScanResult

Instance Method Details

getActiveProfile() as $.EnvironmentProfileModel or Null

Get the active profile

Returns:

  • The current profile, or null if no device connected

initialize(bleDelegate as $.ThingyDelegate, dataModelFactory as $.DataModelFactory, scanResult as BluetoothLowEnergy.ScanResult)

Constructor

Parameters:

  • bleDelegate —

    The BLE delegate for the model

  • dataModelFactory —

    The factory to create models

  • scanResult —

    The device scan result

isConnected() as Lang.Boolean

Get whether a device is connected

Returns:

  • true if connected, false otherwise

pair() as Void

Pair the device associated with the current scan result

procConnection(device as BluetoothLowEnergy.Device) as Void

Process a new device connection

Parameters:

  • device —

    The device that was connected

procDeviceConnected() as Void

Update the profile after a is device connected

unpair() as Void

Unpair the current device


Generated Oct 20, 2026, 8:20:50 AM