IRNAS / koruza-rpi-package

Software package for KORUZA compute module
GNU General Public License v3.0
2 stars 1 forks source link

Add unit-to-unit communication for alignment and nodewatcher reporting #8

Closed SloMusti closed 6 years ago

SloMusti commented 7 years ago

Enable the state of alignment algorithm to be reported from unit to unit, state is defined here: https://github.com/IRNAS/koruza-rpi-package/blob/ca84a247669eb863fb5364a99d5a3390828be385/examples/alignment.py#L161

Report state to nodewatcher as well.

kostko commented 7 years ago

Is it enough for the state to be a single integer? Or should we support something more?

SloMusti commented 6 years ago

Unit-to-unit single state value is sufficient, we may wish to report more values to nodewatceher.

kostko commented 6 years ago

Added in 7b303cfa766282aa38118226576eeff63c9fd4dd.

An ubus call to set_alignment can be used to configure current state and extra variables - the example has been updated to include this new API method, which can be called as local.set_alignment(42, [1,2,3,4]) where 42 is the current state and [1,2,3,4] is a list of extra variables (all four must be sent otherwise the command is invalid).

At the other end, the state and variables can be read as part of the current state (under e.g. remote_status['alignment']['state']).