gpio

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: 5 Imported by: 0

README

tibco-gpio

This activity provides your flogo application the ability to control raspberry pi GPIO

Installation

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

Schema

Inputs and Outputs:

{
  "inputs":[
    {
      "name": "method",
      "type": "string",
      "required": true,
      "allowed" : ["Direction", "Set State", "Read State", "Pull"]
    },
    {
      "name": "pinNumber",
      "type": "integer",
      "required": true
    },
    {
      "name": "direction",
      "type": "string",
      "allowed" : ["Input", "Output"]
    },
    {
      "name": "state",
      "type": "string",
      "allowed" : ["High", "Low"]
    },

    {
      "name": "Pull",
      "type": "string",
      "allowed" : ["Up", "Down", "Off"]
    }
  ],
  "outputs": [
    {
      "name": "result",
      "type": "integer"
    }
  ]
}

Settings

Setting Description
method The method to take action for GPIO
pinNumber The pin number
direction The direction of pin number, either Input or Output
state The state of pin number, either high or low
Pull Pull the pin number to Up, Down and Off

Configuration Examples

Get pin state

Get specific pin 23's state

  "attributes": [
          {
            "name": "method",
            "value": "Read State",
            "type": "string"
          },
          {
            "name": "pinNumber",
            "value": "23",
            "type": "integer"
          }
        ]
Set pin state

Set pin state to High

  "attributes": [
          {
            "name": "method",
            "value": "Set State",
            "type": "string"
          },
          {
            "name": "pinNumber",
            "value": "23",
            "type": "integer"
          },
          {
            "name": "state",
            "value": "High",
            "type": "string"
          }
        ]
Change pin's direction

Change pin's direction to Output

  "attributes": [
          {
            "name": "method",
            "value": "Direction",
            "type": "string"
          },
          {
            "name": "pinNumber",
            "value": "23",
            "type": "integer"
          },
          {
            "name": "direction",
            "value": "Output",
            "type": "string"
          }
        ]

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 GPIOActivity

Types

type GPIOActivity

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

func (*GPIOActivity) Eval

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

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

func (*GPIOActivity) Metadata

func (a *GPIOActivity) 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