Message Action Properties


The message action supports the following arguments, submitted with the args parameter (described in the Properties table for Device Do Action):

Message Action Arguments:

Property

Type

Description

code

Number or string

(Required) code is the message code. A string or a number, typically an integer.  

data

String or
list of numbers

(Optional) data is a series of bytes, supplied as a list of integers, or a UTF-8 string.

For example: “The quick brown fox” or [ 84, 104, 101, …, 120 ]

service

String

(Required) service can be “unacknowledged”, “acknowledged”, or “request”.

Both "acknowledged" and "request" messages support the timeout parameter and a maximum retry count. The "unacknowledged" message supports a repeat count.

addressingString(Optional) addressing can be “physical”, “logical”, “multicast”, “broadcast”.

Defaults to “logical”.

secureBoolean(Optional) secure can be either True or False.  Defaults to the protocol default.
priorityBoolean(Optional) priority can be either True or False.  Defaults to False.
countNumber

(Optional) count is either:

  • the maximum number of retries for "acknowledged" and "request" messages,
  • the maximum number of repeats for "unacknowledged" messages.

Defaults to 3.

timeout

Number

(Optional) timeout is either:

  • the timeout for "acknowledged" or "request" messages, in seconds.
  • the inter-message gap in seconds for "unacknowledged" messages, with count > 0.

Defaults to the shortest possible timeout for the protocol.

optionsObject(Optional) options provides protocol-specific options.

The following example shows the path selection between the “primary” and “secondary” path supported by the LON driver.

Example:

{
      lon: {
            path: “primary”
      }
}

respond

String

(Optional) respond indicates a topic to which the processor publishes the application message completion object. See "Response Topic" below for a description of the response fields.


Response Topic:

The response topic must be a topic local to the edge server shared between the requestor and the processor, or it must be an IAP event channel topic. See Handle Allocation for strategies on allocation of suitable topics.

The application message completion object is published on the respond topic indicated with the application message object:

Field Name

Type

Description

success

Boolean

Always present. A boolean success (true) or failure (false) indicator.  All other response object fields are void if success: false.

code

String or number

Response code, if applicable.

data

String or
list of numbers

For responses to requests, can be null or "undefinedif the response included no data. 
The processor uses the same format as was used with the request.

Example: “ABC” or [ 65, 66, 67 ]

optionsObject

Optional protocol-specific meta data. The following example illustrates how the LON driver reports the response source address.

Example:

{
     lon: {
          source: {
               domainId: “B3”,
               subnet: 199,
               node: 3
          }
     }
}