2021-09-27 10:35:48 +02:00
|
|
|
# rolling-stock-display-simulation-tool
|
|
|
|
|
|
|
|
|
|
A tool for connecting virtual devices to the Rolling Stock platform.
|
|
|
|
|
Devices need to be registered and credentials prepared in a JSON file
|
|
|
|
|
put in input.json (or specified in a variablle)
|
|
|
|
|
|
|
|
|
|
Sample input.json file structure:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[
|
|
|
|
|
{"username": "DEVICE197", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "a32c695ccde9"},
|
|
|
|
|
{"username": "DEVICE198", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "c93f60d35d51"},
|
|
|
|
|
{"username": "DEVICE199", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "ddf4d41f846f"},
|
|
|
|
|
{"username": "DEVICE200", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "07fd03b6fce0"}
|
|
|
|
|
]
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The tool sends regular presence messages (with harcoded dummy versions content)
|
|
|
|
|
and properly responds with "unsupported command" to any command sent to it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Usage:
|
|
|
|
|
|
|
|
|
|
```./rolling-stock-display-simulation-tool```
|
|
|
|
|
|
|
|
|
|
## Building
|
|
|
|
|
|
|
|
|
|
If the target system is linux amd-64 based you can just copy the binary and use it.
|
|
|
|
|
Otherwise build the binary like every other golang binary and then copy it.
|
|
|
|
|
|
|
|
|
|
```go build```
|
|
|
|
|
|
2021-09-14 19:25:37 +02:00
|
|
|
|
|
|
|
|
## Environment variables
|
|
|
|
|
|
2021-09-27 10:23:31 +02:00
|
|
|
| Variable | Required | Default Value | Description |
|
|
|
|
|
| ------------------------------------------------- | -------- | --------------------------------- | -----------------------------------------------------------|
|
|
|
|
|
| **Credentials:** |
|
|
|
|
|
| |
|
|
|
|
|
| CREDENTIALS_FILE_LOCATION | NO | input.json | Database username |
|
|
|
|
|
| |
|
|
|
|
|
| **GeneralOptions:** |
|
|
|
|
|
| |
|
|
|
|
|
| PRESENCE_STATUS_DELAY | NO | 2 min | Delay for online presence message loop |
|
|
|
|
|
| COMMAND_REPLY_DELAY | NO | 10 sec | Delay for command message reply |
|
2021-09-27 19:23:30 +02:00
|
|
|
| EXECUTE_SINGLE_STATUS_MESSAGE | NO | false | Send one presence stanza message for clients and terminate|
|
2021-09-27 10:23:31 +02:00
|
|
|
| |
|
2021-09-13 04:09:40 +00:00
|
|
|
|