public class Spacebrew extends Object
Modifier and Type | Field and Description |
---|---|
String |
description
What does your app do?
|
String |
name
Name of your app as it will appear in the Spacebrew admin.
|
boolean |
verbose
How loud to be (mutes debug messages)
|
Constructor and Description |
---|
Spacebrew(PApplet _parent)
Setup Spacebrew + try to set up default helper functions
|
Modifier and Type | Method and Description |
---|---|
void |
addPublish(String name,
boolean _default)
Setup a Boolean publisher
|
void |
addPublish(String name,
Integer _default)
Setup a Range publisher
|
void |
addPublish(String name,
String _default)
Setup a String publisher
|
void |
addPublish(String name,
String type,
boolean _default)
Setup a custom or boolean publisher
|
void |
addPublish(String name,
String type,
Integer _default)
Setup a custom or integer-based publisher
|
void |
addPublish(String name,
String type,
String _default)
Setup a custom or string publisher
|
void |
addSubscribe(String name,
String type)
Add a subscriber.
|
void |
addSubscribe(String name,
String type,
String methodName)
Add a subscriber + a specific callback for this route.
|
void |
close()
Close the connection to spacebrew
|
void |
connect(String _hostname,
Integer _port,
String _name,
String _description)
Connect to Spacebrew admin.
|
void |
connect(String hostname,
String _name,
String _description)
Connect to Spacebrew admin.
|
boolean |
connected() |
void |
onClose()
Websocket callback (don't call this please!)
|
void |
onMessage(String message)
Websocket callback (don't call this please!)
|
void |
onOpen()
Websocket callback (don't call this please!)
|
void |
pre()
Method that ensure that app attempts to reconnect to Spacebrew if the connection is lost.
|
void |
send(String messageName,
boolean value)
Send a Boolean message along a specified Route
|
void |
send(String messageName,
int value)
Send a Range message along a specified Route
|
void |
send(String messageName,
String value)
Send a String message along a specified Route
|
void |
send(String messageName,
String type,
String value)
Send a message along a specified Route
|
public String name
public String description
public boolean verbose
public Spacebrew(PApplet _parent)
{PApplet}
- public void addPublish(String name, boolean _default)
{String}
- name of route{Boolean}
- default starting valuepublic void addPublish(String name, Integer _default)
{String}
- name of route{Integer}
- default starting valuepublic void addPublish(String name, String _default)
{String}
- name of route{String}
- default starting valuepublic void addPublish(String name, String type, String _default)
{String}
- name of route{String}
- type of route ("range", "boolean", or "string"){String}
- default starting valuepublic void addPublish(String name, String type, boolean _default)
{String}
- name of route{String}
- type of route ("range", "boolean", or "string"){Boolean}
- default starting valuepublic void addPublish(String name, String type, Integer _default)
{String}
- name of route{String}
- type of route ("range", "boolean", or "string"){Boolean}
- default starting valuepublic void addSubscribe(String name, String type)
{String}
- name of route{String}
- type of route ("range", "boolean", or "string")public void addSubscribe(String name, String type, String methodName)
{String}
- name of route{String}
- name of method{String}
- type of route ("range", "boolean", or "string")public void connect(String hostname, String _name, String _description)
{String}
- URL to Spacebrew host{String}
- Name of your app as it will appear in the Spacebrew admin{String}
- What does your app do?public void connect(String _hostname, Integer _port, String _name, String _description)
{String}
- URL to Spacebrew host{String}
- Name of your app as it will appear in the Spacebrew admin{String}
- What does your app do?public void pre()
public void close()
public void send(String messageName, String type, String value)
{String}
- Name of Route{String}
- Type of Route ("boolean", "range", "string"){String}
- What you're sendingpublic void send(String messageName, int value)
{String}
- Name of Route{Integer}
- What you're sendingpublic void send(String messageName, boolean value)
{String}
- Name of Route{boolean}
- What you're sendingpublic void send(String messageName, String value)
{String}
- Name of Route{String}
- What you're sendingpublic boolean connected()
public void onOpen()
public void onClose()
public void onMessage(String message)
Processing Library spacebrew by Brett Renfer. (c) 2015 Spacebrew