Inherits from NSObject
Declared in LEDevice.h

Overview

A device represents the physical device / Hub. The device may have a number of services (inputs, motors, etc).

The LEDeviceManager can be used to scan for and connect to an LEDevice.

Implement the LEDeviceServiceDelegate to be notified about changes to the service attributes, for instance when a sensor has a new reading.

Tasks

Attached services (motors, sensors, etc).

Device info and attributes

Add and remove delegates

Check for equality

Properties

buttonPressed

The most recent button pressed state read from the Device .

@property (nonatomic, readonly, getter=isButtonPressed) BOOL buttonPressed

Discussion

The most recent button pressed state read from the Device .

Declared In

LEDevice.h

category

The System Category of the connected Device

@property (nonatomic, readonly) LEDeviceCategory category

Discussion

The System Category of the connected Device

Declared In

LEDevice.h

connectState

Returns the current state of the connection.

@property (nonatomic, readonly) LEDeviceState connectState

Discussion

Returns the current state of the connection.

Declared In

LEDevice.h

deviceId

A unique identifier for the device

@property (nonatomic, readonly) NSString *deviceId

Discussion

A unique identifier for the device

Declared In

LEDevice.h

deviceInfo

Info about the device hardware, firmware, and software revision

@property (nonatomic, readonly) LEDeviceInfo *deviceInfo

Discussion

Info about the device hardware, firmware, and software revision

Declared In

LEDevice.h

externalServices

An external service is a service that represent and IO that can be attached to the device Hub. Examples include the LEMotor, LETiltSensor and LEMotionSensor

@property (nonatomic, readonly) NSArray *externalServices

Discussion

An external service is a service that represent and IO that can be attached to the device Hub. Examples include the LEMotor, LETiltSensor and LEMotionSensor

Declared In

LEDevice.h

internalServices

An internal service is a service that is inherent to the device - something that can never be ‘detached’. Examples include the LEVoltageSensor and LECurrentSensor that

@property (nonatomic, readonly) NSArray *internalServices

Discussion

An internal service is a service that is inherent to the device - something that can never be ‘detached’. Examples include the LEVoltageSensor and LECurrentSensor that

Declared In

LEDevice.h

lastConnectedNetworkId

The ID of the network this Device was connected to last

@property (nonatomic, readonly) NSUInteger lastConnectedNetworkId

Discussion

The ID of the network this Device was connected to last

Declared In

LEDevice.h

lowVoltage

True if the a low voltage alert has been received from the Device, indicating that batteries should be changed/charged

@property (nonatomic, readonly) BOOL lowVoltage

Discussion

True if the a low voltage alert has been received from the Device, indicating that batteries should be changed/charged

Declared In

LEDevice.h

name

The most recent value of the name property read from the Hub.

@property (nonatomic, copy) NSString *name

Discussion

The most recent value of the name property read from the Hub.

Writing to this property will immediately update the property value, even though the actual write to the hardware is asynchronously, and may potentially fail. When the write completes the [LEBluetoothHubDelegate:didChangeNameFrom:to:error] is invoked.

Declared In

LEDevice.h

services

The currently available inputs and outputs

@property (nonatomic, readonly) NSArray *services

Discussion

The currently available inputs and outputs

Declared In

LEDevice.h

supportedFunctions

The Fuction(s) supported by the connected Device

@property (nonatomic, readonly) LEDeviceFunction supportedFunctions

Discussion

The Fuction(s) supported by the connected Device

Declared In

LEDevice.h

Instance Methods

addDelegate:

If a delegate is registered it receives callbacks on changes to offered services, as well as properties of the device like name and color.

- (void)addDelegate:(id<LEDeviceDelegate>)delegate

Parameters

delegate

The delegate to add

Discussion

If a delegate is registered it receives callbacks on changes to offered services, as well as properties of the device like name and color.

Declared In

LEDevice.h

isEqualToDevice:

Returns YES if this device is equal to otherDevice

- (BOOL)isEqualToDevice:(LEDevice *)otherDevice

Parameters

otherDevice

The device to be compared to the receiver.

Discussion

Returns YES if this device is equal to otherDevice

Declared In

LEDevice.h

removeDelegate:

Remove delegate from this device

- (void)removeDelegate:(id<LEDeviceDelegate>)delegate

Parameters

delegate

The delegate to remove

Discussion

Remove delegate from this device

Declared In

LEDevice.h