registering c++ functions into scxml ecmascript to be used from the state machine js code
-
wrote on 10 Jul 2018, 19:36 last edited by
Hi, I'm working on a project which makes use of scxml to represent a state machine and listens to mqtt channels to receive events which will change states. Is it somehow possible to register a function which listens to the mqtt channel into ecmascript like you can do with qtscript so I can use it from the state machine ? I searched through the examples but I couldn't find any examples of what I want to accomplish.
Thanks for your time.
-
Hi, I'm working on a project which makes use of scxml to represent a state machine and listens to mqtt channels to receive events which will change states. Is it somehow possible to register a function which listens to the mqtt channel into ecmascript like you can do with qtscript so I can use it from the state machine ? I searched through the examples but I couldn't find any examples of what I want to accomplish.
Thanks for your time.
wrote on 11 Jul 2018, 20:12 last edited by@nurettin what about using a QMqttClient instead of javascript? You can subscribe to topics and react to its messageReceived() signal. I guess that depending on the topic/message received you could go on and update the state machine accordingly
-
@nurettin what about using a QMqttClient instead of javascript? You can subscribe to topics and react to its messageReceived() signal. I guess that depending on the topic/message received you could go on and update the state machine accordingly
wrote on 11 Jul 2018, 21:17 last edited by@Pablo-J.-Rogina That is a good idea, but I would like to upload any generic scxml + js pair to my program and run the logic without writing any additional c++ code except the pub/sub calls. I got a hint on stackoverflow that I may register QML functions into scxml ecmascript model, so the problem may be solved already.
-
@Pablo-J.-Rogina That is a good idea, but I would like to upload any generic scxml + js pair to my program and run the logic without writing any additional c++ code except the pub/sub calls. I got a hint on stackoverflow that I may register QML functions into scxml ecmascript model, so the problem may be solved already.
wrote on 12 Jul 2018, 00:33 last edited by@nurettin I see, gettting the scxml + js outside the application seems more versatile
I got a hint on stackoverflow
Could it be possible you provide a link to such Q&A for anybody interested? Thanks
2/4