coap

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: BSD-3-Clause Imports: 7 Imported by: 0

README

tibco-coap

This activity provides your flogo application the ability to send a CoAP message.

Installation

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

Schema

Inputs and Outputs:

{
  "inputs":[
    {
      "name": "uri",
      "type": "string",
      "required": true
    },
    {
      "name": "method",
      "type": "string",
      "required": true
    },
    {
      "name": "queryParams",
      "type": "params"
    },
    {
      "name": "type",
      "type": "string"
    },
    {
      "name": "messageId",
      "type": "integer"
    },
    {
      "name": "options",
      "type": "params"
    },
    {
      "name": "payload",
      "type": "string"
    }
  ],
  "outputs": [
    {
      "name": "response",
      "type": "string"
    }
  ]
}

Settings

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

Configuration Examples

Simple

Configure a task in flow to send a "hello world" message via CoAP:

{
  "id": 3,
  "type": 1,
  "activityType": "tibco-coap",
  "name": "Send CoAP Message",
  "attributes": [
    { "name": "method", "value": "POST" },
    { "name": "address", "value": "coap://localhost:5683/device" },
    { "name": "type", "value": "Confirmable" },
    { "name": "messageId", "value": 12345 },
    { "name": "payload", "value": "hello world" },
    { "name": "options", "value": {"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