...
Communication with External Applications
WebSocket APIs
Apart from manual editing the config.json configuration script or modifying it through the GUI, FusionHub also offers a WebSocket API for external application to change its configuratuion. In fact the GUI uses this interface to access FusionHub’s settings.
Note that the websocket communication is currently not encrypted, it is not secure. Please take your own precautions to make sure network traffic for the configuration isn’t intercepted in some way. We might add an option for secure communication in future releases.
The WebSocket server can be accessed via 19358
port on the machine hosting the FusionHub service. To accelerate development download the Simple WebSocket Client Chrome plugin. This allows you to manually enter API commands and check the replies from the server.
Endpoint | Sample Requests | Sample Response / Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
getConfig |
| Get in memory configurations. | ||||||||||
getSavedConfig |
| Get on disk configurations. | ||||||||||
saveConfig |
| Save the in-memory configurations to the disk. | ||||||||||
setConfig |
| Update in-memory configurations. This api create new key-value pairs, or update the existing values. It does not save configurations to the disk. Note that in | ||||||||||
overwriteConfig |
| Overwrite the in-memory configurations. This is suitable when user want to remove a key from the configuration. | ||||||||||
getIntercalibrationStatus |
| Get the current intercalibration status. Useful for refetching current status when the frontnend accidentally disconnects. | ||||||||||
applyIntercalibrationResults |
| Apply the current intercalibration quaternion to the in-memory copy of config. This does NOT save to disk. | ||||||||||
restartBackend |
| Restart the backend. Internally the while loop reset the DataBlock, causing all sources and sinks to be freed from memory, and instantiate them again. | ||||||||||
getVersion |
|
|
Sending FusionHub Data to External Applications via the ZeroMQ Interface
...