Methods
broadcast(data)
Sends a message to all connected devices.
Parameters:
Name | Type | Description |
---|---|---|
data |
- Source:
message(device_id, data)
Sends a message to another device.
Parameters:
Name | Type | Description |
---|---|---|
device_id |
number | undefined | The device ID to send the message to. If "device_id" is undefined, the message is sent to all devices (except this one). |
data |
- Source:
(abstract) onMessage(device_id, data)
Gets called when a message is received from another device
that called message() or broadcast().
If you dont want to parse messages yourself and prefer an event driven
approach, @see http://github.com/AirConsole/airconsole-events/
Parameters:
Name | Type | Description |
---|---|---|
device_id |
number | The device ID that sent the message. |
data |
serializable | The data that was sent. |
- Source: