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

src/rsu-connector: add status iothub status file output #8

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

feckert
Copy link
Contributor

@feckert feckert commented Dec 14, 2023

This pullrequest adds the following changes.

  1. Add missing No newline at end of file for files where it is missing, because a Linux editor expects it. Otherwise a change is displayed although there is none.
  2. Pass internal Iothub state in a status file on every callback call to process this outside the rsu connector.

When saving the file with a linux editor the missing new line is added.
The git programme, after saving the file, always shows
'No newline at end of file' for a `git diff`.

To make the editor happy, the commit adds the missing new line at the
end of file to every file where it is missing.

Signed-off-by: Florian Eckert <[email protected]>
When saving the file with a linux editor the missing new line is added.
The git programme, after saving the file, always shows
'No newline at end of file' for a `git diff`.

To make the editor happy, the commit adds the missing new line at the
end of file to every file where it is missing.

Signed-off-by: Florian Eckert <[email protected]>
This change is intended to make the internal connection state to the iothub
accessible for possible further processing outside of the rsu connector.

Therefore, the connection state is saved in a file with every callback
call to the iothub.

There is a new configuration option 'HUB_StatusFile' for the config
file. This option contains a path to a file in which the internal state
is stored as json. This file should be stored in tmp, as it is written
with every callback call. The directory must exist otherwise the file
cannot be created.

The file could have one of the following states:

{ "status": "OK" }
{ "status": "EXPIRED_SAS_TOKEN" }
{ "status": "DEVICE_DISABLED" }
{ "status": "BAD_CREDENTIAL" }
{ "status": "RETRY_EXPIRED" }
{ "status": "NO_NETWORK" }
{ "status": "COMMUNICATION_ERROR" }
{ "status": "OK" }
{ "status": "NO_PING_RESPONSE" }
{ "status": "UNKNOWN" }

Signed-off-by: Florian Eckert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant