Connections

Sequence of ConnectionActions to run upon BLE Connection. Triggered by the connect filter


ConnectionAction

Action to take once BLE Connection is established. Chained together in a ConnectionSequence.

Referenced By:
EdgeConnectConfig   RecipeDefinition  

Fields

NameTypeDescriptionRequired
configobjectConfiguration information for the particular type of Action used. Described in the documentation for each Action type.

In addition to the config parameters specific to each Action type, you may also specify these debug options in the config map:

  • debug - a bool indicating whether to perform debug logging

  • verbose - a bool indicating whether to perform verbose logging

  • debugInput

    Enable logging a custom map built from the input map; will override the default event logging.
    Define the map as key pairs (see inject), supports dot-notation, templating.

    e.g.: {"importantValue":"{{.nested.important.value}}"}



  • debugOutput

    Enable logging a custom map built from the output map; will override the default event logging.

    Define the map as key pairs (see inject), supports dot-notation, templating.

    e.g.: {"importantValue":"{{.nested.important.value}}"}



No
typestringThe unique type of the Action, must match the type of one of the available ConnectionActions.
Example: "read"
Yes

Example

{
  "service": {
    "actions": {
      "read-custom-char": {
        "config": {
          "characteristic": "2a26",
          "longRead": false,
          "mode": "append",
          "outputKey": "logs",
          "service": "375aee4c-6dea-5105-9074-14d5ba44f766"
        },
        "type": "read"
      }
    }
  }
}

ConnectionSequence

Sequence of ConnectionActions to run upon BLE Connection. Triggered by the connect filter.

Referenced By:
EdgeConnectConfig   RecipeDefinition  

Fields

NameTypeDescriptionRequired
actionsarrayList of ConnectionAction identifiers.

References the actions defined on Config.
Yes
allowEarlyExitbooleanAllow for the connection to exit, but proceed with the rest of the pipeline.
Default behavior (false) will end the pipeline if the connection ends prematurely.
This does not allow errors to proceed, only actions that return nil.
No
attemptsintegerWhen set to a value greater than 0, the set of actions for the connection will be
attempted the number of specified times. Note that this only applies to when a
connection is successfully made to a device. If a device is not present and the
connection request times out, no further attempts to connect will occur until an
advertisement from the device is seen again.
This minimum number of attempts is 1. The maximum is 10.
No
debugbooleanEnable debug loggingNo
verbosebooleanEnable verbose loggingNo

Example

{
  "service": {
    "connections": {
      "readBatteryConn": {
        "actions": [
          "read-custom-battery",
          "update-custom-metadata"
        ]
      }
    }
  }
}