RDK Resources
RDK Preferred
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
org.rdk.Network.1 - initial version of the Network API.
Description: Returns a list of interfaces supported by this device including their state.
Arguments: none
Returns: interfaces::Array - an array of strings of the network interfaces
Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getInterfaces", "params":{}} Response: {"jsonrpc":"2.0", "id":3, "result": {"interfaces": [ { "interface":"WIFI", "macAddress":"AA:AA:AA:AA:AA:AA", "enabled":true, "connected":true }, { "interface":"MOCHA", "macAddress":"AA:AA:AA:AA:AA:AB", "enabled":false, "connected":false }, { "interface":"ETHERNET", "macAddress":"AA:AA:AA:AA:AA:AD", "enabled":false, "connected":false } ] } } uint32_t mn(const JsonObject& parameters, JsonObject& response);
Description: Returns true if the specified interface is enabled
Arguments: interface::String
Returns: enabled:boolean
Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.isInterfaceEnabled", "params":{"interface":"WIFI"}} Response: {"jsonrpc":"2.0", "id":3, "result": {"enabled":true} } uint32_t mn(const JsonObject& parameters, JsonObject& response);
Description: Enables the specified interface when enables is true. Disables when enabled is false.
Arguments:
Returns:
Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.setInterfaceEnabled", "params":{"interface":"WIFI", "enabled":true, "persist":true}} Response: {"jsonrpc":"2.0", "id":3, "result": 0} uint32_t mn(const JsonObject& parameters, JsonObject& response);
Description: Sets the default interface. This should fail if the interface is not enabled.
Arguments:
Returns: None
Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.setDefaultInterface", "params":{ "interface":"WIFI", "persist":true}} Response: {"jsonrpc":"2.0", "id":3, "result": {}} uint32_t mn(const JsonObject& parameters, JsonObject& response);
Description: Gets the default network interface. The active network interface is defined as the one that can make requests to the external network. Returns one of the supported interfaces as per getInterfaces, or "" indicating that there is no default network interface.
Arguments: none
Returns: interface::String
Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getDefaultInterface", "params":{}} Response: {"jsonrpc":"2.0", "id":3, "result": {"interface":"WIFI"}} uint32_t mn(const JsonObject& parameters, JsonObject& response);
Description: Gets the IP address of the default interface.
Arguments: none
Returns: ip : String
Request : {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getStbIp", "params":{}} Response: {"jsonrpc":"2.0","id":3,"result":{"ip":"10.42.0.213","success":true}} uint32_t mn(const JsonObject& parameters, JsonObject& response);
Description: Pings the specified endpoint host name or IP address. The ping command will send the specified number of packets to the endpoint. Default packets is 15.
Arguments:
Returns:
Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.ping", "params":{ "endpoint": "45.57.221.20", "packets": 10 }} Response: {"jsonrpc":"2.0", "id":3, "result":{ "target" : "173.194.123.7", "success" : true, "packetsTransmitted" : 10, "packetsReceived" : 10, "packetLoss" : "0.0", "tripMin" : "61.264", "tripAvg" : "130.397", "tripMax" : "230.832", "tripStdDev" : "80.919", "error" : null }} uint32_t ping(const JsonObject& parameters, JsonObject& response);
Description: Pings the endpoint named by endpointName. Only names returned by getNamedEndpoints can be used. The named endpoint will be resolved to a specific host or ip address on the device side base on the endpointName. The ping command will send the specified number of packets to the endpoint. Default packets is 15.
Arguments:
Returns:
Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.pingNamedEndpoint", "params":{ "endpointName": "CMTS", "packets": 10 }} Response: {"jsonrpc":"2.0", "id":3, "result":{ "target" : "173.194.123.7", "success" : true, "packetsTransmitted" : 10, "packetsReceived" : 10, "packetLoss" : "0.0", "tripMin" : "61.264", "tripAvg" : "130.397", "tripMax" : "230.832", "tripStdDev" : "80.919", "error" : null }} uint32_t pingNamedEndpoint(const JsonObject& parameters, JsonObject& response);
Description: Traces the specified endpoint host name or IP address using traceroute. The trace command will send the specified number of packets to the endpoint. Default packets is 15.
Arguments:
Returns:
Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.trace", "params":{ "endpoint": "45.57.221.20", "packets": 10 }} Response: {"jsonrpc":"2.0", "id":3, "result":{ "target" : "173.194.123.7", "success" : true, "error" : null, "results" : "<<<traceroute command results>>>" }} uint32_t trace(const JsonObject& parameters, JsonObject& response);
Description: Traces the specified endpoint host name or IP address using traceroute. The trace command will send the specified number of packets to the endpoint. Default packets is 15.
Arguments:
Returns:
Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.traceNamedEndpoint", "params":{ "guid": "iasoviubejcv", "endpointName": "CMTS", "packets": 10 }} Response: {"jsonrpc":"2.0", "id":3, "result":{ Response: {"jsonrpc":"2.0", "id":3, "result":{ "target" : "173.194.123.7", "success" : true, "error" : null, "results" : "<<<traceroute command results>>>" }} uint32_t traceNamedEndpoint(const JsonObject& parameters, JsonObject& response);
Description: Returns a list of endpoint names. Currently supported endpoint names are: CMTS
Arguments: None
Returns: endpoints:Array - an array of named endpoints for use in pingNamedEndpoints or traceNamedEndpoint.
Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getNamedEndpoints", "params":{}} Response: {"jsonrpc":"2.0", "id":3, "result":{"endpoints":["CMTS"]}} uint32_t getNamedEndpoints(const JsonObject& parameters, JsonObject& response);
Description: Gets the IP setting for the given interface
Arguments:
Returns:
Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.getIPSettings", "params":{ "interface": "wifi" }} Response: {"jsonrpc":"2.0", "id":3, "result":{ "interface": "wifi", "ipversion": "IPv4 "autoconfig": true, "ipaddr": “192.168.1.101", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "primarydns": "192.168.1.1", "secondarydns": "" } }
Description: Sets the IP settings
Arguments:
Returns:
Request: {"jsonrpc":"2.0", "id":3, "method":"org.rdk.Network.1.setIPSettings", "params":{ "interface": "wifi", "ipversion": "IPv4", "autoconfig": true, "ipaddr": “192.168.1.101", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "primarydns": "192.168.1.1", "secondarydns": "" }} Response: {"jsonrpc":"2.0", "id":3, "result":{ "supported": true, "success": true } }
Description: Fired when a connection is made or lost
Payload:
{ "jsonrpc":"2.0", "method":"org.rdk.Network.1.onConnectionStatusChanged", "params": {"interface":"WIFI", status:"CONNECTED"} }
Description: Fired when an IP Address is assigned or lost
Payload:
{ "jsonrpc":"2.0", "method":"org.rdk.Network.1.onIPAddressStatusChanged", "params": { "interface":"WIFI", "ip6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "ip4Address":"106.146.207.16", "status":"ACQUIRED"} }
Description: Fired when the default interface changes, regardless if from a system operation or through this API
Payload:
{ "jsonrpc":"2.0", "method":"org.rdk.Network.1.onDefaultInterfaceChanged", "params": { "oldInterfaceName":"ETHERNET", "newInterfaceName":"WIFI" } }
Description: Fired when the an interface becomes enabled or disabled
Payload:
{ "jsonrpc":"2.0", "method":"org.rdk.Network.1.onInterfaceStatusChanged", "params": { "interface":"WIFI", "enabled":true } }
1 Comment
Justin Ware
Documentation of "getSTBIPFamily" is missing.