Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. registering c++ functions into scxml ecmascript to be used from the state machine js code
Forum Updated to NodeBB v4.3 + New Features

registering c++ functions into scxml ecmascript to be used from the state machine js code

Scheduled Pinned Locked Moved Unsolved General and Desktop
scxml
4 Posts 2 Posters 969 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nurettin
    wrote on last edited by
    #1

    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.

    Pablo J. RoginaP 1 Reply Last reply
    0
    • N nurettin

      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.

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @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

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      N 1 Reply Last reply
      1
      • Pablo J. RoginaP Pablo J. Rogina

        @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

        N Offline
        N Offline
        nurettin
        wrote on last edited by
        #3

        @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. RoginaP 1 Reply Last reply
        0
        • N nurettin

          @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. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          @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

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved