Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend HTTP protocol adapter to support commands and their responses. #618

Closed
sysexcontrol opened this issue May 15, 2018 · 1 comment
Closed
Assignees
Projects
Milestone

Comments

@sysexcontrol
Copy link
Contributor

The HTTP protocol adapter needs to treat commands from an application and must be extended for this purpose.

TODOs (maybe not complete yet):

  • define headers that identify a command and are sent to a device (to enable it for sending responses)
  • delay responses by using the ttd value (that is available as header already)
  • put a command to the body of the response
  • describe the new HTTP features and how they enable command and control for a HTTP device
  • define an event specifically for sending a response from the device to the application that has sent the command (maybe piggy backing other messages is sufficient for empty command responses that do not need the payload to contain the response)
sysexcontrol added a commit that referenced this issue May 15, 2018
Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
@sysexcontrol sysexcontrol self-assigned this May 16, 2018
sysexcontrol added a commit that referenced this issue May 18, 2018
This commit provides only the utility methods to transport the two parts as
one String (that can serve as a request-id). In followup messages
this String can be split into the original ones again by invoking the
inverse utility method.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 18, 2018
Besides supporting downstream messages, the HTTP protocol
adapter now supports to receive a command from an application
if a downstream message indicates that it stays connected
by using the `hono-ttd` parameter.
A command is sent to the device in the response payload of
the request with a `hono-cmd-req-id' parameter.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 18, 2018
…notified.

Currently, there are only 'void' command supported and only the
HTTP adapter supports to receive a command.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 22, 2018
Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 22, 2018
… 200 to app.

To achieve a successful command pattern inside the application, the
HTTP PA answers a received command by replying to the application with a
status 200. Although a real answer from the device is not yet implemented,
this follows the future implementation of expecting a response from the
device already.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 22, 2018
Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 22, 2018
Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 22, 2018
… 200 to app.

To achieve a successful command pattern inside the application, the
HTTP PA answers a received command by replying to the application with a
status 200. Although a real answer from the device is not yet implemented,
this follows the future implementation of expecting a response from the
device already.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit that referenced this issue May 22, 2018
Besides supporting downstream messages, the HTTP protocol
adapter now supports to receive a command from an application
if a downstream message indicates that it stays connected
by using the `hono-ttd` parameter.
A command is sent to the device in the response payload of
the request with a `hono-cmd-req-id' parameter.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit that referenced this issue May 22, 2018
Currently, there are only 'void' command supported and only the
HTTP adapter supports to receive a command.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit that referenced this issue May 22, 2018
Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit that referenced this issue May 22, 2018
To achieve a successful command pattern inside the application, the
HTTP PA answers a received command by replying to the application with a
status 200. Although a real answer from the device is not yet implemented,
this follows the future implementation of expecting a response from the
device already.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 22, 2018
…application.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 22, 2018
…xample app.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 22, 2018
Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 23, 2018
…application.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit to bosch-io/hono that referenced this issue May 23, 2018
…xample app.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit that referenced this issue May 23, 2018
Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit that referenced this issue May 23, 2018
Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sysexcontrol added a commit that referenced this issue May 23, 2018
Without ensuring correct clocks, the command and control example may not
work correctly since timestamps may be considered expired already.

Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
@sophokles73 sophokles73 added this to To do in 0.6 via automation May 24, 2018
@sophokles73 sophokles73 added this to the 0.6 milestone May 24, 2018
@sysexcontrol
Copy link
Contributor Author

Fixed by the referencing commits.

0.6 automation moved this from To do to Done May 24, 2018
sysexcontrol added a commit that referenced this issue May 24, 2018
Signed-off-by: Karsten Frank <Karsten.Frank@bosch-si.com>
sophokles73 pushed a commit that referenced this issue Aug 6, 2018
Signed-off-by: Kai Hudalla <kai.hudalla@bosch-si.com>
sophokles73 pushed a commit that referenced this issue Aug 6, 2018
The telemetry and event endpoints now include the TTD header in the list
of allowed headers in response to a CORS preflight request.

The control endpoint now includes the (required) "hono-cmd-status"
header in the list of allowed headers in response to a
CORS preflight request.

Signed-off-by: Kai Hudalla <kai.hudalla@bosch-si.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
0.6
  
Done
Development

No branches or pull requests

2 participants