# Connection Manager

The Connection Manager getstatus method allows you to get the current status of the data connection and optionally subscribe to status change notifications.

## Objects

This section describes the following objects:

- btpan
- wan
- wifi

### btpan

Attribute | Type | Description
--- | --- | ---
ipAddress | string | The Bluetooth PAN IP address.
panUser | string | Set to the name of the Bluetooth PAN client that is connected to the device.
state | string | Set to either "connected" or "disconnected".

### wan

Attribute | Type | Description
--- | --- | ---
ipAddress | string | The WAN IP address.
network | string | Set to "unknown", "unusable", "gprs", "edge", "umts", "hsdpa", "1x", or "evdo". Note: "unusable" is a special condition where the WAN interface is still connected, but data cannot be sent or received.
state | string | Set to either "connected" or "disconnected".

### wifi

Attribute | Type | Description
--- | --- | ---
bssid | string | The basic service set identifier (BSSID) of the connected virtual access point (AP).
ipAddress | string | The Wi-Fi IP address.
ssid | string | The service set identifier (SSID) of the connected AP.
state | string | Set to either "connected" or "disconnected".

## Method

This section describes the following method:

- getstatus

### getstatus

Gets the connections status and optionally subscribes to connection notification.

Required parameters: None.

#### Parameters

Parameter | Type | Description
--- | --- | ---
subscribe | boolean | Optional. Set to true for subscriptions. Default is false.

#### Return Handling

onSuccess

Returns an object containing the following attributes.

Attribute | Type | Description
--- | --- | ---
errorCode | integer | Set to the error value if an invalid return.
errorText | string | Set to the error text value if an invalid return.
isInternetConnectionAvailable | boolean | Set to true if the connection is available; false if not.
returnValue | boolean | true. If the subscribe parameter was set to true when this was called, this item is only received on the initial call.
wifi | object | Wi-Fi information. See the Objects section.
wan | object | wan information. See the Objects section.
btpan | object | btpan information. See the Objects section.

onFailure

Attribute | Type | Description
--- | --- | ---
errorCode | string | Numeric string representing an error code: For unknown. For failing to subscribe successfully.
errorText | string | Text string representing an error for display if needed.
returnValue | boolean | false

#### Example

>     this.controller.serviceRequest('palm://com.palm.connectionmanager', {
>       method: 'getstatus',
>       parameters: {},
>       onSuccess: function(response){},
>       onFailure: function(response){}
>     });

## Sample Code

See Services Sample.