Module: caf_iot/plug_iot_cloud

Connects this device with its corresponding CA.

Properties:

 {tokenFile: string, appProtocol: string, appPublisher: string,
  appLocalName: string, appSuffix: string, session: string}

where:

  • tokenFile: the name of a file containing an authentication token.
  • appProtocol: protocol to contact the CA, e.g., https.
  • appPublisher: the publisher of this app.
  • appLocalName: the local name of the app.
  • appSuffix: the URL suffix, e.g., cafjs.com.
  • session: The persistent session identifier.
Source:

Extends

Methods

getMethodArgs(msg) → {Array.<jsonType>}

Gets original method arguments from message.

Parameters:
Name Type Description
msg msgType

A message

Source:
Throws:

when invalid message.

Type
Error
Returns:

An array with method arguments.

Type
Array.<jsonType>

registerHandler(handler)

Registers a handler to process messages.

This is equivalent to that.cli.onmessage = handler

Parameters:
Name Type Description
handler function | null

A function of type function(msgType) to process notifications. null deregisters previous handlers.

Source: