Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Make sure that you have SSH enabled, and redirected ports (look above in this page)
  2. From chrome extenstion download "Browser WebSocket Client"
  3. URL and Protocol can be taken from "thunder-wifimanager-test.js", when creating this instruction it was:

    Code Block
    ws =
     new WebSocket
     new WebSocket('ws://localhost:9998/jsonrpc', 'notification');


  4. Going with this example our URL should be 'ws://localhost:9000/jsonrpc' (NOTICE: port is different as we redirected it before), and Protocol should be 'notification'. All those fields should not have [ ' ] characters.

  5. Now we can register to get some message, In Send a Message field just paste request, i.e.


    1. Code Block
      {

    1. 
          "jsonrpc": "2.0",

    1. 
          "id":
     123123123
    1.  123123123,

    1. 
          "method": "Controller.1.register",

    1. 
          "params": {

    1. 
              "event": "all",

    1. 
              "id": "client.events.1"

    1. 
          }

    1. 
      }


      and press Send. In reveived Messages should be shown response.
  6. Then we can check if we will get new message if registered even appeard. We can do it be i.e.


    1. Code Block
      {

    1. 
          "jsonrpc": "2.0",

    1. 
          "id":
     1234567890
    1.  1234567890,

    1. 
          "method": "Controller.1.deactivate",

    1. 
          "params": {

    1. 
              "callsign": "DeviceInfo"

    1. 
          }

    1. 
      }


    2. We should get 2 messages. One about success of this operation and second about event that we are registered.

Getting events from desired service

To get event from specific service we need to set service name and event that we want to catch. So if we want i.e. get from HomeNetworking, get event deviceDiscoveryUpdate. We need to

Code Block
{

...


    "jsonrpc": "2.0",

...


    "id":

...

 123123123,

...


    "method": "org.rdk.HomeNetworking.1.register",

...


    "params": {

...


        "event": "deviceDiscoveryUpdate",

...


        "id": "client.events.1"

...


    }

...


}

Important: name of service can be different on the box (here "org.rdk." was prefixed) to check how service is called in the box use command:

Code Block
curl --location --request

...

 GET 'http://127.0.0.1:9998/Service/Controller' | json_reformat

There you can find all services.