Subscription

driver. Subscription

Members

(readonly) address :driver.Address

The first device tag this subscription monitors.

Type:

(readonly) latestData :Object

The latest response data.

Type:
  • Object

(readonly) length :Number

Number of device tags this subscription monitors.

Type:
  • Number

Methods

onResponse(callback)

Register the response callback.

Example
subscription.onResponse((err, data) => {
    if (err) {
        console.log('Error:', err.message);
    } else {
        ...
    }
});
Parameters:
Name Type Description
callback driver~ResponseCallback | null

If callback is:

  • ResponseCallback ⇨ Replace previous response callback (if exists) with this function.
  • null ⇨ Cancel the previous response callback.