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:
  • none -- No confidence in this connection, typically seen when the connection is unusable for getting to local network. Refer to onInternet for connectivity to Internet.
  • poor -- No persistent connection or the radios are communicating that the network is not very reliable.
  • fair -- Steady connection but the bandwidth is not good.
  • excellent -- Network connection should be operating at it fullest potential.
onInternet string One of the following:
  • yes -- Connected to Internet.
  • no -- Not connected to Internet.
  • testing -- Testing connectivity to Internet.
  • captivePortal -- The captive portal technique forces an HTTP client on a network to see a special web page (usually for authentication purposes) before using the Internet normally. Captive portals are used at most Wi-Fi hotspots.
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:
  • unknown -- Network unknown.
  • unusable -- The WAN interface is still connected, but data cannot be sent or received.
  • gprs-- (General Packet Radio Service.) Provides the transmission of IP packets over existing cellular networks.
  • edge -- (Enhanced Data rates for GSM Evolution.) The EDGE network is a data network used by AT&T and T-Mobile. It is not a true 3G network (considered 2G), as its speeds don't exceed 200 Kbps, but it is sometimes called a "high-speed" network.
  • umts -- (Universal Mobile Telecommunication System.) The UMTS network is a wireless 3G network that provides high bandwidth voice and data service.
  • hsdpa -- (High-Speed Downlink Packet Access.) A fast 3G network used by AT&T and T-Mobile. HSDPA is the fastest of the fast 3G networks; sometimes called a 3.5G network.
  • 1x -- (Single carrier (1x) radio transmission technology.) A 3G wireless technology based on the CDMA platform.
  • evdo -- (Evolution-Data Optimized or Evolution-Data only (EV-DO, EV, etc.).) A telecommunications standard for the wireless transmission of data through radio signals, typically for broadband Internet access
networkConfidenceLevel string One of the following:
  • none -- No confidence in this connection, typically seen when the connection is unusable for getting to the local network. Refer to onInternet for connectivity to the Internet.
  • poor -- No persistent connection or the radios are communicating that the network is not very reliable.
  • fair -- Steady connection, but the bandwidth is not good.
  • excellent -- Network connection should be operating at its fullest potential.
onInternet string One of the following:
  • yes -- Connected to Internet.
  • no -- Not connected to Internet.
  • testing -- Testing connectivity to Internet.
  • captivePortal -- The captive portal technique forces an HTTP client on a network to see a special web page (usually for authentication purposes) before using the Internet normally. Captive portals are used at most Wi-Fi hotspots.
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.