FirstLegoLeague / displaySystem

Set of display tools
https://firstlegoleague.github.io/displaySystem/
4 stars 7 forks source link

Refactor listening to mhub messages #20

Closed rikkertkoppes closed 8 years ago

rikkertkoppes commented 8 years ago

Now we also send mhub messages as a result of button presses, listening to them should be equivalent.

Generalize the whole thing to a point where there is a 1-1 relation between module api calls and incoming messages. That is:

module.action(param1,param2)

should be equivalent to

{"topic":"module:action", "data":{"param1":value1,"param2":value2}}

This is now already the case for messages that are sent, but messages received could be generalized the same way (each message is now handled individually)