Top | ![]() |
![]() |
![]() |
![]() |
TrackerNetworkProviderTrackerNetworkProvider — Network status interface for cross platform backends |
The TrackerNetworkProvider allows different backends to be written for retrieving network connectivity status information. This can be used to avoid heavy transfers when on a slow connection, or on a connection where costs may apply. Currently, there are two implementations. The NetworkManager one uses NetworkManager, and the Dummy one will always expose the network as connected, no matter what the connectivity status actually is.
TrackerNetworkProvider *
tracker_network_provider_get (void
);
This function MUST be defined by the implementation of TrackerNetworkProvider.
For example, tracker-network-provider-network-manager.c should include this function for a NetworkManager implementation.
Only one implementation can exist at once.
Since 0.10
gchar *
tracker_network_provider_get_name (TrackerNetworkProvider *provider
);
At the moment there are only two providers, "Dummy" and "NetworkManager". Either of these is what will be returned unless new providers are written.
a newly allocated string representing the name
which must be freed with g_free()
.
[transfer full]
Since 0.10
TrackerNetworkProviderStatus
tracker_network_provider_get_status (TrackerNetworkProvider *provider
);
This function calls the network provider's "get_status" implementation.
Since 0.10
typedef struct { GTypeInterface parent_iface; TrackerNetworkProviderStatus (* get_status) (TrackerNetworkProvider *provider); } TrackerNetworkProviderIface;
Since 0.10
Enumerates the different types of connections that the device might use when connected to internet. Note that not all providers might provide this information.
Network is disconnected |
||
Network status is unknown |
||
Network is connected over a GPRS connection |
||
Network is connected over an EDGE connection |
||
Network is connected over a 3G or faster (HSDPA, UMTS, ...) connection |
||
Network is connected over a local network connection. This can be ethernet, wifi, etc. |
Since 0.10