new Response(data)
- Source:
The base class of all responses.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Buffer | The received data used to build this Resopnse |
Members
adapter :Adapter
- Source:
The adapter instance
Type:
address :Object
- Source:
The transport address
Type:
- Object
device :Device
- Source:
The device the command was sent to
Type:
name :String
- Source:
Returns the name of the reponse. Used to match the adapter opts.
Type:
- String
value :String|Number|Boolean
- Source:
Returns the value to be set on the K4Model variable
Type:
- String | Number | Boolean
Methods
(static) fromData(data, adapter) → {Response|null}
- Source:
Returns an instance of the response class if the class can parse the data
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Buffer | The data received |
adapter |
Adapter | The adapter instance |
Returns:
- Type
- Response | null
(abstract) init()
- Source:
Parses the data from this._data