public class

Blink1Module

extends Object
java.lang.Object
   ↳ org.mule.module.blink1.Blink1Module
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

A connector for the blink(1) device.

{@sample.config INCLUDE_ERROR}

Summary

Constants
int FAILED
int MAX_PATTERN_POSITION
String PROJECT_ISSUES_MESSAGE
Fields
private static final Map<String, Color> COLOR_MAP
private static final Log LOGGER
private Blink1 blink1
Public Constructors
Blink1Module()
Public Methods
void clearPattern(int deviceId)
Clear the pattern stored in a blink(1) device.
void fadeToColor(int deviceId, int duration, String color)
Fade-in the color.
List<Blink1Status> getStatuses()
Get the status of all the connected blink(1) devices.
void loadNativeLibrary()
static Color parseColor(String colorString)
void setColor(int deviceId, String color)
Set the color.
void startPattern(int deviceId, int position)
Start playing the stored pattern.
void startServerDown(int deviceId, int delay)
Schedule playing the server down pattern.
void stopPattern(int deviceId)
Stop playing the stored pattern.
void stopServerDown(int deviceId)
Stop playing the server down pattern or cancel its scheduled execution.
void storePattern(int deviceId, List<PatternEntry> entries, int startPosition)
Store a pattern.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

private static final int FAILED

Constant Value: -1 (0xffffffff)

public static final int MAX_PATTERN_POSITION

Constant Value: 11 (0x0000000b)

private static final String PROJECT_ISSUES_MESSAGE

Constant Value: "Please report this issue at https://github.com/mulesoft/blink1-connector/issues"

Fields

private static final Map<String, Color> COLOR_MAP

private static final Log LOGGER

private Blink1 blink1

Public Constructors

public Blink1Module ()

Public Methods

public void clearPattern (int deviceId)

Clear the pattern stored in a blink(1) device.

Parameters
deviceId Unique identifier of the device.

public void fadeToColor (int deviceId, int duration, String color)

Fade-in the color.

Parameters
deviceId Unique identifier of the device.
duration Time in milliseconds that the fading lasts.
color Either a Color name or an HTML color.

public List<Blink1Status> getStatuses ()

Get the status of all the connected blink(1) devices.

Returns

public void loadNativeLibrary ()

Throws
IOException

public static Color parseColor (String colorString)

Parameters
colorString

public void setColor (int deviceId, String color)

Set the color.

Parameters
deviceId Unique identifier of the device.
color Either a Color name or an HTML color. The on and off aliases are recognized as WHITE and BLACK.

public void startPattern (int deviceId, int position)

Start playing the stored pattern.

Parameters
deviceId Unique identifier of the device.
position Where to start playing the pattern. Between 0 and MAX_PATTERN_POSITION.

public void startServerDown (int deviceId, int delay)

Schedule playing the server down pattern.

Parameters
deviceId Unique identifier of the device.
delay Time in milliseconds after which the pattern will play.

public void stopPattern (int deviceId)

Stop playing the stored pattern.

Parameters
deviceId Unique identifier of the device.

public void stopServerDown (int deviceId)

Stop playing the server down pattern or cancel its scheduled execution.

Parameters
deviceId Unique identifier of the device.

public void storePattern (int deviceId, List<PatternEntry> entries, int startPosition)

Store a pattern.

Parameters
deviceId Unique identifier of the device.
entries Definition of the pattern.
startPosition Position at which the pattern must be stored. Between 0 and MAX_PATTERN_POSITION.