coap

package
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

README


title: CoAP weight: 4607

CoAP

This activity allows you to send a CoAP message.

Installation

Flogo Web

This activity comes out of the box with the Flogo Web UI

Flogo CLI

flogo add activity github.com/TIBCOSoftware/flogo-contrib/activity/coap

Schema

Inputs and Outputs:

{
  "input":[
    {
      "name": "uri",
      "type": "string",
      "required": true
    },
    {
      "name": "method",
      "type": "string",
      "required": true,
      "allowed" : ["GET", "POST", "PUT", "DELETE"]
    },
    {
      "name": "queryParams",
      "type": "params"
    },
    {
      "name": "type",
      "type": "string"
    },
    {
      "name": "messageId",
      "type": "integer"
    },
    {
      "name": "options",
      "type": "params"
    },
    {
      "name": "payload",
      "type": "string"
    }
  ],
  "output": [
    {
      "name": "response",
      "type": "string"
    }
  ]
}

Settings

Setting Required Description
uri True The CoAP resource URI
method True The CoAP method (Accepted values are POST, GET, PUT, and DELETE)
queryParams False The query parameters
type False Message Type (Confirmable, NonConfirmable, Acknowledgement, Reset)
messageId False ID used to detect duplicates and for optional reliability
options False CoAP options
payload False The message payload

Example

The below example sends a "hello world" message via CoAP:

{
  "id": "coap",
  "name": "Send CoAP Message",
  "description": "Simple CoAP Activity",
  "activity": {
    "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/coap",
    "input": {
      "method": "POST",
      "address": "coap://localhost:5683/device",
      "type": "Confirmable",
      "messageId": 12345,
      "payload": "hello world",
      "options": {"ETag":"tag", "MaxAge":2 }
    }
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActivity

func NewActivity(metadata *activity.Metadata) activity.Activity

NewActivity creates a new CoAP activity

Types

type CoAPActivity

type CoAPActivity struct {
	// contains filtered or unexported fields
}

CoAPActivity is an Activity that is used to send a CoAP message inputs : {method,type,payload,messageId} outputs: {result}

func (*CoAPActivity) Eval

func (a *CoAPActivity) Eval(context activity.Context) (done bool, err error)

Eval implements api.Activity.Eval - Invokes a REST Operation

func (*CoAPActivity) Metadata

func (a *CoAPActivity) Metadata() *activity.Metadata

Metadata returns the activity's metadata

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL