BUDevicePoller Class Reference

Inherits from NSObject
Declared in BUDevicePoller.h

Overview

Poll the Electric Imp server for device information

The BUDevicePoller is used after configuring a device with a network configuration. The poller is created based on a BUConfigId and needs to be manually started. Once stated, the poller will poll the Electric Imp server until the device contacts the server or a timeout period has lapsed.

– init

Please use initWithConfigId:

- (nonnull instancetype)init

Return Value

An Exception will be thrown

Discussion

Please use initWithConfigId:

Declared In

BUDevicePoller.h

– initWithConfigId:

Create a device poller to retrieve device information

- (nonnull instancetype)initWithConfigId:(nonnull BUConfigId *)configId

Parameters

configId

ConfigId that was transmitted to the device

Return Value

an intialized device poller

Declared In

BUDevicePoller.h

– stopPolling

Stop the current status verification

This will stop the SDK from polling and prevents the startPollingWithCompletionHandler completionHandler from being called. Typically done after the end user has blinked up and is waiting for status verification and the end user hits some kind of cancel or back button because the don’t want to wait for verification to complete.

- (void)stopPolling

Declared In

BUDevicePoller.h

– startPollingWithCompletionHandler:

Start polling for information about a device

Query the Electric Imp server to see if the device has connected

If using Swift and want enumerated results, please use the Swift extension method

- (void)startPollingWithCompletionHandler:(nullable DevicePollingDidCompleteBlock)completionHandler

Parameters

completionHandler

Block that is executed when the device connection attempt is complete (success or failure)

Declared In

BUDevicePoller.h

  pollTimeout

Time to wait before giving up on device connection

After the device is configured, it will take the imp some time to connect to the server and for the application to retrieve the AgentUrl. By default this time period will last 60 seconds. If you wish to override the timeout period, this property can be set with the number of seconds before the AgentUrl checking times out

@property (nonatomic) NSTimeInterval pollTimeout

Declared In

BUDevicePoller.h

  configId

The configId pass in during initialization to be used for reference

@property (nonatomic, strong, readonly, nonnull) BUConfigId *configId

Declared In

BUDevicePoller.h