Inherits from NSObject
Declared in ABLight.h
ABLight.m

Overview

  • ABLight defines the property of light and method to communicate with light

Properties

currentLight

currentLight

@property (nonatomic) NSUInteger currentLight

Discussion

currentLight

Current light value

Declared In

ABLight.h

delegate

delegate

@property (nonatomic, weak) id<ABLightDelegate> delegate

Discussion

delegate

Delegate of ABLight, used to call lightDidConnected:withError and lightDidDisconnected:withError.

Declared In

ABLight.h

peripheral

peripheral

@property (nonatomic, strong) CBPeripheral *peripheral

Discussion

peripheral

CBPeripheral object of the light.

Declared In

ABLight.h

Instance Methods

connect

Connect to ABLight to communicate with it

- (void)connect

Return Value

void

Discussion

Connect to ABLight to communicate with it

Declared In

ABLight.h

disconnect

Disconnect with the ABLight

- (void)disconnect

Return Value

void

Discussion

Disconnect with the ABLight

Declared In

ABLight.h

initWithPeripheral:

Init mehtod of ABLight with CBPeripheral object.

- (instancetype)initWithPeripheral:(CBPeripheral *)peripheral

Parameters

peripheral

CBPeripheral object

Return Value

void

Discussion

Init mehtod of ABLight with CBPeripheral object.

Declared In

ABLight.h

setLightValue:withCompletion:

Modify the light value of ABLight

- (void)setLightValue:(NSInteger)lightValue withCompletion:(ABCompletionBlock)completion

Parameters

lightValue

The value to be set, the range is 0-255

completion

The callback when complete the event

Return Value

void

Discussion

Modify the light value of ABLight

Declared In

ABLight.h