Editing Documentation/Maemo 5 Developer Guide/Using Connectivity Components/Maemo Connectivity

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.

Warning: This page is 60 kilobytes long; some browsers may have problems editing pages approaching or longer than 32kb. Please consider breaking the page into smaller sections.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 22: Line 22:
This section describes the system decomposition of the Connectivity subsystem. Maemo applications can open Internet connections by using the LibConIC API. The Internet Access subsystem take care of the connection to the phone, if necessary, by using the services of the Phone Access subsystem. If an application needs to gain access to the phone's files, the File selector consults the Phone Access subsystem.
This section describes the system decomposition of the Connectivity subsystem. Maemo applications can open Internet connections by using the LibConIC API. The Internet Access subsystem take care of the connection to the phone, if necessary, by using the services of the Phone Access subsystem. If an application needs to gain access to the phone's files, the File selector consults the Phone Access subsystem.
-
In offline mode, none of the radios must be active. The [[Documentation/Maemo 5 Developer Guide/Architecture/System Software#Device State Management Entity (DSME)|Device System Management Entity (DSME)]] of Maemo provides information about the transitions to and from the offline mode.
+
In offline mode, none of the radios must be active. The Device System Management Entity (DSME) of Maemo provides information about the transitions to and from the offline mode.
-
;Name
+
{| class="wikitable"
-
: Connectivity UI
+
! Name
-
;Purpose
+
! Connectivity UI
-
: Provides the UI for managing phone and Internet connections. Available as a Control Panel applet, and from the Status Bar.
+
|-
-
;Responsibilities and additional requirements
+
| Purpose
-
: <ul><li>Displaying active connections with statistics</li><li>Updating status indicators</li><li>Providing dialogs for changing and disconnecting connections</li></ul>
+
| Provides the UI for managing phone and Internet connections. Available as a Control Panel applet, and from the Status Bar.
-
;Concurrent usage
+
|-
-
: (N/A)
+
| Responsibilities and additional requirements
 +
|
 +
* Displaying active connections with statistics
 +
* Updating status indicators
 +
* Providing dialogs for changing and disconnecting connections
 +
|-
 +
| Concurrent usage
 +
| (N/A)
 +
|}
-
;Name
+
{| class="wikitable"
-
: Phone Access
+
! Name
-
;Purpose
+
! Phone Access
-
: Provides connections to phones with different Bluetooth profiles
+
|-
-
;Responsibilities and additional requirements
+
| Purpose
-
: <ul><li>Searching for phones and inquiring their services</li><li>Keeping phone register</li><li>Providing status of the phone connections for Connectivity UI</li><li>Binding RFCOMM devices to Bluetooth services on the phone</li><li>Providing easy access to OpenOBEX</li></ul>
+
| Provides connections to phones with different Bluetooth profiles
-
;Concurrent usage
+
|-
-
: Number of clients not limited by Maemo. However, some phones may not support more than one Bluetooth profile at a time.
+
| Responsibilities and additional requirements
 +
|
 +
* Searching for phones and inquiring their services
 +
* Keeping phone register
 +
* Providing status of the phone connections for Connectivity UI
 +
* Binding RFCOMM devices to Bluetooth services on the phone
 +
* Providing easy access to OpenOBEX
 +
|-
 +
| Concurrent usage
 +
| Number of clients not limited by Maemo. However, some phones may not support more than one Bluetooth profile at a time.
 +
|}
-
;Name
+
{| class="wikitable"
-
: Internet Access
+
! Name
-
;Purpose
+
! Internet Access
-
: Provides Internet connections over different bearers.
+
|-
-
;Responsibilities and additional requirements
+
| Purpose
-
: <ul><li>Providing means for configuration and management of IAP settings</li><li>Providing API for Internet connections over different bearers (e.g. WLAN, GPRS)</li><li>Providing status of Internet connections for Connectivity UI</li></ul>
+
| Provides Internet connections over different bearers.
-
;Concurrent usage
+
|-
-
: Number of clients not limited, but only one connection to the Internet can exist at any given time
+
| Responsibilities and additional requirements
 +
|
 +
* Providing means for configuration and management of IAP settings
 +
* Providing API for Internet connections over different bearers (e.g. WLAN, GPRS)
 +
* Providing status of Internet connections for Connectivity UI
 +
|-
 +
| Concurrent usage
 +
| Number of clients not limited, but only one connection to the Internet can exist at any given time
 +
|}
Phone and Internet connections are quite different by nature and behavior. These are introduced in more detail in the following sections.
Phone and Internet connections are quite different by nature and behavior. These are introduced in more detail in the following sections.
Line 113: Line 139:
: IC daemon establishes Internet connections over different bearers.
: IC daemon establishes Internet connections over different bearers.
;Responsibilities and additional requirements
;Responsibilities and additional requirements
-
: <ul><li>Controlling that only one Internet connection (one active IAP) can exist at any given time</li><li>Using WLAN or GPRS connection daemon for getting a network device and getting the connection authenticated</li><li>Starting IP level services like PPP and DHCP</li><li>Providing statistics about the usage of IAPs to any application</li></ul>
+
: <ul><li>Controlling that only one Internet connection (one active IAP) can exist at any given time</li><li>Using WLAN or GPRS connection daemon for getting a network device and getting the connection authenticated</li><li>Starting IP level services like PPP and DHCP</li><li>Providing statistics about the usage of IAPs to any application</li>
;Concurrent usage
;Concurrent usage
: Has multiple clients and limits the connections to one at a time
: Has multiple clients and limits the connections to one at a time
Line 241: Line 267:
==== Requesting for Connection ====
==== Requesting for Connection ====
-
[http://maemo.org/api_refs/5.0/5.0-final/libconic/ LibConIc] is an asynchronous connection API, which heavily relies on <code>GObject</code> signals. Basically this means that <code>GMainloop</code> must be iterated in order to successfully execute connection requests. After the application is set up, use a <code>ConIcConnection</code> object to request a connection:
+
Libconic is an asynchronous connection API, which heavily relies on <code>GObject</code> signals. Basically this means that <code>GMainloop</code> must be iterated in order to successfully execute connection requests. After the application is set up, use a <code>ConIcConnection</code> object to request a connection:
<source lang="c">
<source lang="c">
Line 255: Line 281:
</source>
</source>
-
At this point, the application does not yet have an Internet connection. A successful return from <code>con_ic_connection_connect()</code> means only that the request was successfully dispatched to the Internet Connectivity daemon. When the daemon has a connection ready, the application receives an [http://maemo.org/api_refs/5.0/5.0-final/libconic/conicconnectionevent_8h.html event] (as an <code>GObject</code> signal) indicating that the device is connected. If the connection attempt fails, the application receives a disconnected event with an error describing the reason for the failure.
+
At this point, the application does not yet have an Internet connection. A successful return from <code>con_ic_connection_connect()</code> means only that the request was successfully dispatched to the Internet Connectivity daemon. When the daemon has a connection ready, the application receives an event (as an <code>GObject</code> signal) indicating that the device is connected. If the connection attempt fails, the application receives a disconnected event with an error describing the reason for the failure.
The connection handler (<code>my_connection_handler()</code> function registered in the previous snippet) could look like this:
The connection handler (<code>my_connection_handler()</code> function registered in the previous snippet) could look like this:
Line 510: Line 536:
=== Discovering devices ===
=== Discovering devices ===
-
Maemo provides a D-Bus interface for displaying a Bluetooth device search dialog (You can find a list of available Bluetooth D-Bus calls [[#D-Bus Connectivity UI Interface|below]]).  
+
Maemo provides D-BUS interface for displaying bluetooth device search dialog (You can find list of available Bluetooth D-BUS calls [[#D-Bus Connectivity UI Interface|here]]).  
Devices can be searched with following steps:
Devices can be searched with following steps:
-
# Set up a D-Bus connection
+
# Set up D-BUS connection
-
# call <code>bt_ui.search_req</code> to show the dialog - you can filter the results
+
# call bt_ui.search_req to show dialog - you can filter the results
-
# catch <code>bt_ui.search_result</code> signal
+
# catch bt_ui.search_result signal
-
# process the results
+
# process results
 +
 
-
Here is a working example in C:
+
Here's working example in C how this is done:
<source lang="c">
<source lang="c">
-
// Bluetooth discovery example - bluetooth libraries will not work in the SDK!
+
//Bluetooth discovery example - bluetooth libraries won't work in SDK!
#include <hildon/hildon-program.h>
#include <hildon/hildon-program.h>
#include <dbus/dbus.h>
#include <dbus/dbus.h>

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)