Skip to content

Commit

Permalink
DELIA-66644 : Updated documentation & GetIPSettings return value (rdk…
Browse files Browse the repository at this point in the history
…central#22)

Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
  • Loading branch information
karuna2git authored and parvathika committed Nov 7, 2024
1 parent 2e91180 commit 02516d5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 24 deletions.
12 changes: 8 additions & 4 deletions NetworkManager.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@
"result": {
"type": "object",
"properties": {
"Interfaces": {
"summary": "An interface",
"interfaces": {
"summary": "An interface details",
"type":"array",
"items": {
"type":"object",
Expand Down Expand Up @@ -372,7 +372,9 @@
"ipversion": {
"$ref": "#/definitions/ipversion"
}
}
},
"required": [
]
},
"result": {
"type": "object",
Expand Down Expand Up @@ -910,7 +912,9 @@
"example": "Xfinity Mobile"
}
}
}
},
"required": [
]
},
"result": {
"type": "object",
Expand Down
17 changes: 10 additions & 7 deletions NetworkManagerJsonRpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,16 @@ namespace WPEFramework
response["interface"] = interface;
response["ipversion"] = address.ipversion;
response["autoconfig"] = address.autoconfig;
response["ipaddress"] = address.ipaddress;
response["prefix"] = address.prefix;
response["ula"] = address.ula;
response["dhcpserver"] = address.dhcpserver;
response["gateway"] = address.gateway;
response["primarydns"] = address.primarydns;
response["secondarydns"] = address.secondarydns;
if (!address.ipaddress.empty())
{
response["ipaddress"] = address.ipaddress;
response["prefix"] = address.prefix;
response["ula"] = address.ula;
response["dhcpserver"] = address.dhcpserver;
response["gateway"] = address.gateway;
response["primarydns"] = address.primarydns;
response["secondarydns"] = address.secondarydns;
}
}
returnJson(rc);
}
Expand Down
10 changes: 5 additions & 5 deletions NetworkManagerRDKProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,12 +837,12 @@ namespace WPEFramework
if (IARM_RESULT_SUCCESS == IARM_Bus_Call (IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_NETSRVMGR_API_getIPSettings, (void *)&iarmData, sizeof(iarmData)))
{
address.autoconfig = iarmData.autoconfig;
address.dhcpserver = string(iarmData.dhcpserver,MAX_IP_ADDRESS_LEN - 1);
address.dhcpserver = string(iarmData.dhcpserver);
address.ula = string("");
address.ipaddress = string(iarmData.ipaddress,MAX_IP_ADDRESS_LEN - 1);
address.gateway = string(iarmData.gateway,MAX_IP_ADDRESS_LEN - 1);
address.primarydns = string(iarmData.primarydns,MAX_IP_ADDRESS_LEN - 1);
address.secondarydns = string(iarmData.secondarydns,MAX_IP_ADDRESS_LEN - 1);
address.ipaddress = string(iarmData.ipaddress);
address.gateway = string(iarmData.gateway);
address.primarydns = string(iarmData.primarydns);
address.secondarydns = string(iarmData.secondarydns);
if (0 == strcasecmp("ipv4", iarmData.ipversion))
{
address.ipversion = string ("IPv4");
Expand Down
16 changes: 8 additions & 8 deletions docs/NetworkManagerPlugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ This method takes no parameters.
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| result | object | |
| result?.Interfaces | array | <sup>*(optional)*</sup> An interface |
| result?.Interfaces[#] | object | <sup>*(optional)*</sup> |
| result?.Interfaces[#].type | string | Interface Type |
| result?.Interfaces[#].name | string | Interface Name. ex: eth0 or wlan0 |
| result?.Interfaces[#].mac | string | Interface MAC address |
| result?.Interfaces[#].enabled | boolean | Whether the interface is currently enabled |
| result?.Interfaces[#].connected | boolean | Whether the interface is currently connected |
| result.interfaces | array | An interface details |
| result.interfaces[#] | object | |
| result.interfaces[#].type | string | Interface Type |
| result.interfaces[#].name | string | Interface Name. ex: eth0 or wlan0 |
| result.interfaces[#].mac | string | Interface MAC address |
| result.interfaces[#].enabled | boolean | Whether the interface is currently enabled |
| result.interfaces[#].connected | boolean | Whether the interface is currently connected |
| result.success | boolean | Whether the request succeeded |

### Example
Expand All @@ -242,7 +242,7 @@ This method takes no parameters.
"jsonrpc": "2.0",
"id": 42,
"result": {
"Interfaces": [
"interfaces": [
{
"type": "ETHERNET",
"name": "eth0",
Expand Down

0 comments on commit 02516d5

Please sign in to comment.