...
- Make sure that you have SSH enabled, and redirected ports (look above in this page)
- From chrome extenstion download "Browser WebSocket Client"
URL and Protocol can be taken from "thunder-wifimanager-test.js", when creating this instruction it was:
new
WebSocket new WebSocket('ws://localhost:9998/jsonrpc', 'notification'); |
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.
Now we can register to get some message, In Send a Message field just paste request, i.e.
123123123
"method": "Controller.1.register", |
and press Send. In reveived Messages should be shown response.
Then we can check if we will get new message if registered even appeard. We can do it be i.e.
1234567890
"method": "Controller.1.deactivate", |
- 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
...
...
...
...
"method": "org.rdk.HomeNetworking.1.register", |
...
...
"event": "deviceDiscoveryUpdate", |
...
...
...
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.