Skip to main content

imp.enableblinkup(enabled)

Enables or disables BlinkUp™ on a device

Availability

Device

Parameters

Name Type Description
enabled Bool Whether BlinkUp configuration should be enabled (true) or disabled (false)

Returns

Nothing

Description

This method can be used to activate or deactivate BlinkUp, both the ability to register a signal from a mobile device and the reporting of the process by way of the device’s BlinkUp status LED. As such, it can be used to prevent re-starting devices from flashing their status LED. This is handy for devices which you would like to operate discreetly.

The call is interpreted differently according to the state of the system. The relevant system states are:

  • BOOTING — Within 60 seconds of the imp being cold-started (see note below for warm-boot behavior).
  • CONNECTING — Within 60 seconds of the imp first attempting to connect to the server.
  • IDLE — All other times.

Calls to imp.enableblinkup() are applied only when the imp enters a new systems state. However, calls made during a given state are ‘remembered’ and applied the next time the state changes. Naturally, it is impossible to apply the call before the imp enters the booting phase.

For example, suppose that during BOOTING, the programmer makes the call for BlinkUp configuration to be disabled. For the remainder of the 60 seconds of the booting state, BlinkUp will remain enabled. However, when the state transitions to CONNECTING or to IDLE, then BlinkUp will become disabled.

The behaviour can be summarised as follows:

BOOTING CONNECTING IDLE
No call ON ON OFF
enableblinkup(false) ON OFF OFF
enableblinkup(true) ON ON ON

Note When an imp warm-starts after deep sleep, imp.enableblinkup() will be applied almost immediately because the imp goes straight to the active offline state — Squirrel starts immediately, and BlinkUp will be disabled (or re-enabled) as soon as the virtual machine processes your code’s call to imp.enableblinkup().

Example Code

The following code, for the impExplorer™ Kit, uses imp.enableblinkup() to disable BlinkUp and thus prevent the Kit’s BlinkUp status LED from flashing when the Kit wakes from the deep sleep state triggered in the last line. As such, the Kit, which is here operating as a sensor node, will not disturb end-users with a periodic flash of the LED.