Connection Manager
The Connection Manager service -- com.palm.connectionmanager -- has one method: getstatus.
getStatus
Returns the current data connection status and, optionally, alllows subscription to status change notifications.
Syntax
{
"subscribe" : boolean
}
Parameters
| Parameter | Required | Type | Description |
| subscribe | No | boolean |
Set to true to receive connection updates. Default is false.
|
Returns
{
"returnValue" : boolean,
"isInternetConnectionAvailable" : boolean,
"wifi":
{
"state" : string,
"ipAddress" : string,
"interfaceName" : string,
"ssid" : string,
"bssid" : string,
"networkConfidenceLevel" : string,
"onInternet" : string,
"isWakeOnWifiEnabled" : boolean
},
"wan":
{
"state" : string,
"ipAddress" : string,
"network" : string,
"networkConfidenceLevel" : string,
"onInternet" : string
},
"vpn":
{
"state" : string,
"interfaceName" : string,
"ipAddress" : string,
"vpnProfileName" : string
},
"bridge":
{
"state" : string,
"ipAddress" : string,
"interfaceName" : string,
"clients" : object array,
[{
"ipAddress" : string,
"type" : string
}],
},
"errorCode" : string,
"errorText" : string
}
| Parameter | Type | Description |
| returnValue | boolean |
true (success) or false (failure).
|
| isInternetConnectionAvailable | boolean | Is Internet connection available flag. |
| wifi | object | Wifi object, see fields below. |
| state | string | connected|disconnected |
| ipAddress | string | IP address. |
| interfaceName | string | Interface name, i.e., "eth0" |
| ssid | string | The Service Set IDentifier (SSID) for the connected wireless access point (WAP). |
| bssid | string | The Basic Service Set IDentifier (BSSID) for the connected virtual access point (VAP). |
| networkConfidenceLevel | string |
One of the following:
|
| onInternet | string |
One of the following:
|
| isWakeOnWifiEnabled | boolean | If "true", the WiFi interface will stay up even when suspended. |
| wan | object | WAN object, see fields below. |
| state | string | connected|disconnected |
| interfaceName | string | Name of the WAN interface connected to the client, i.e., "ppp0". |
| ipAddress | string | IP address. |
| network | string |
One of the following:
|
| networkConfidenceLevel | string |
One of the following:
|
| onInternet | string |
One of the following:
|
| vpn | object | VPN object, see fields below. |
| state | string | connected|disconnected |
| ipAddress | string | IP address. |
| interfaceName | string | Name of the VPN interface connected to the client. |
| vpnProfileName | string | Name of the active VPN Profile. |
| bridge | object | Bridge object, see fields below. |
| state | string | connected|disconnected |
| ipAddress | string | IP address. |
| interfaceName | string | Name of the VPN interface connected to the client. |
| clients | object array | |
| ipAddress | string | IP address |
| type | string | bluetooth|wifi |
| errorCode | string | Error code on failure. |
| errorText | string | Error message on failure. |
Examples
Enyo
...
{
name : "getConnMgrStatus",
kind : "PalmService",
service : "palm://com.palm.connectionmanager/",
method : "getStatus",
onSuccess : "statusFinished",
onFailure : "statusFail",
onResponse : "gotResponse",
subscribe : true
},
...
statusFinished : function(inSender, inResponse) {
enyo.log("getStatus success, results=" + enyo.json.stringify(inResponse));
},
statusFail : function(inSender, inResponse) {
enyo.log("getStatus failure, results=" + enyo.json.stringify(inResponse));
},
getStatus : function(inSender, inResponse)
{
this.$.getConnMgrStatus.call({ "subscribe": true });
}
Mojo
this.controller.serviceRequest('palm://com.palm.connectionmanager', {
method: 'getstatus',
parameters: {},
onSuccess : function (e){ Mojo.Log.info("getStatus success, results="+JSON.stringify(e)); },
onFailure : function (e){ Mojo.Log.info("getStatus failure, results="+JSON.stringify(e)); }
});
Success
getStatus success, results=
{
"returnValue":true,
"isInternetConnectionAvailable":true,
"wifi":{
"state":"connected",
"ipAddress":"10.91.1.98",
"interfaceName":"eth0",
"ssid":"OneTeam",
"bssid":"00:17:DF:A9:F7:6D",
"networkConfidenceLevel":"excellent",
"onInternet":"yes",
"isWakeOnWifiEnabled":true
},
"wan":{
"state":"disconnected"
},
"vpn":{
"state":"disconnected"
},
"bridge":{
"state":"disconnected"
}
}
Sample Code
See Services Sample.