Uploaded image for project: ' AGL Development'
  1. AGL Development
  2. SPEC-4105

Calling verb of "low-can" in agl-cluster-demo-dashboard is failing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Critical Critical
    • None
    • Koi 11.0.3
    • Instrument Cluster
    • None
    • QEMU x86_64

      We are trying to get the engine speed from cluster which we have implemented in qt-qml by using command in qemu "afb-client-demo -H ws://localhost:30007/api?token=x low-can get {"event": "messages.engine.speed"}"

      we have added following code in cluster-dashboard qml:

      property string api_str: "low-can"
      property string verb_str: "subscribe"
      property var msgid_enu: { "call":2, "retok":3, "reterr":4, "event":5 }
      property string request_str: ""
      property string status_str: ""

      property double speed_val: 2
      property double engineSpeed: 1

      WebSocket {
      id: websocket
      url: bindingAddress

      onTextMessageReceived: {
      var message_json = JSON.parse (message);
      if (message_json[0] === msgid_enu.event) {

      var property_name = message_json[2].event.split("/")[1]
      if(property_name === "messages.vehicle.average.speed")

      { speed_val = message_json[2].data.value }

      else if (property_name === "messages.engine.speed")

      { engineSpeed = message_json[2].data.value }

      }
      else
      {
      if (message_json[0] !== msgid_enu.retok)

      { console.log ("Return value is not ok !") return }

      }
      }
      onStatusChanged: {
      if (websocket.status == WebSocket.Error)

      { status_str = "Error: " + websocket.errorString }

      else
      if (websocket.status == WebSocket.Open) {
      status_str = "Socket opened; sending message..."
      if (verb_str == "subscribe")

      { request_str ='[' + msgid_enu.call + ',"99998","' + api_str '/' verb_str +'",

      { \"event\" : \"vehicle.average.speed\" }

      ]';
      websocket.sendTextMessage (request_str)
      request_str ='[' + msgid_enu.call + ',"99999","' + api_str '/' verb_str +'",

      { \"event\" : \"engine.speed\" }

      ]';
      websocket.sendTextMessage (request_str)
      }
      } else
      if (websocket.status == WebSocket.Closed)

      { status_str = "Socket closed" }

      console.log (status_str)
      }
      active: true
      }

       

      low-can service is included in packagegroup and its visible in qemu also

      we are able to call list verb by using: qemux86-64:~# afb-client-demo -H ws://localhost:30007/api?token=x low-can list 

      but while calling "get "or "write"verb with arguments its showing response below:

      qemux86-64:~# afb-client-demo -H ws://localhost:30007/api?token=x low-can get {"event": "messages.engine.speed"}
      usage: afb-client-demo [options]... uri [api verb [data]]
      afb-client-demo -d [options]... uri [verb [data]]

      allowed options
      -b, --break Break connection just after event/call has been emitted.
      -d, --direct Direct api
      -e, --echo Echo inputs
      -h, --help Display this help
      -H, --human Display human readable JSON
      -k, --keep-running Keep running until disconnect, even if input closed
      -p, --pipe COUNT Allow to pipe COUNT requests
      -r, --raw Raw output (default)
      -s, --sync Synchronous: wait for answers (like -p 1)
      -t, --token TOKEN The token to use
      -u, --uuid UUID The identifier of session to use
      Example:
      afb-client-demo --human 'localhost:1234/api?token=HELLO&uuid=magic' hello ping

       

      Please help with correct method to call verb with argument or suggest anything which we are missing.

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            bharatkalamkar3 Bharat .K
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: