Giter Site home page Giter Site logo

mrcjkb / forte_http_comm Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 53 KB

Simple HTTP communication layer for 4diac-RTE (FORTE) [migrated to official FORTE repo, no longer maintained here]

Home Page: http://fordiac.org/

License: Eclipse Public License 1.0

CMake 3.84% C++ 96.16%

forte_http_comm's Introduction

FORTE HTTP Com Layer

Simple HTTP Com Layer for 4diac-RTE (FORTE).

This repository is no longer maintained!

It has been migrated to the official FORTE project. There will be no further development on this repository. As long as it has not yet been published to the stable version of FORTE, you can still use this repository or download/pull the develop branch of FORTE for the latest version of this module. โ€‹

Requires

Installation

  • Add the folder containing the source files to the FORTE modules directory (src/modules/)
  • In CMake GUI, enable FORTE_COM_HTTP โ€‹

Documentation

  • Currently, only HTTP GET and PUT requests are supported.
  • For GET requests, use a CLIENT_0_1 function block.
  • For PUT requests, use a CLIENT_1_0 or CLIENT_1 function block
  • Other function blocks are currently not supported and may result in unexpected behaviour.

Parameters

http[ip:port/path]
http[ip:port/path;expected_response_code]

  • ip: The IP address
  • port: The port number
  • path: The path in the URL
  • expected_response_code (optional): The expected HTTP response code (= "HTTP/1.1 200 OK" if none is specified)

examples:
http[144.12.131.2:80/rest/battery/voltage]
http[144.12.131.2:80/rest/battery/voltage;HTTP/1.1 201 Created]

Notes

  • The project is still in its early development stages. The interface is subject to change.
  • A CHttpParser class is used to parse the HTTP requests and responses in the communication layer. It was designed with the goal of requesting measurements and setting values via a REST server. Thus, it is assumed that a number is returned for the GET request and a number is sent for the PUT request. To adjust the parsing of requests and responses, change the CHttpParser class accordingly.
  • In the long run, a factory for the CHttpParser may be implemented.
  • The following IEC 61499 data types are currently NOT supported for PUT requests: DATE, DATE_AND_TIME, TIME_OF_DAY, arrays, structs
  • By default, a GET request is sent as:
    GET /path HTTP/1.1
    Host: ip:port"

  • By default, a PUT request is sent as:
    PUT /path HTTP/1.1
    Host: ip:port
    Content-type: text/html
    Content-length: length_of_data_string


    data_string
  • If the CLIENT function block has a data output, the HTTP response code (e.g., "HTTP/1.1 404 Not found") is output along with a "SEND_FAILED" status output in the case of an unexpected response. The default expected response code is "HTTP/1.1 200 OK".

forte_http_comm's People

Contributors

mrcjkb avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

forte_http_comm's Issues

Publish the code to the forte repository

Hi. I was just wondering if it would be possible that you push your code to the public repository of forte, so we can later maintain and use it without problems. I'm not sure if there are issues with the license or so

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.