}
}
+static const char *test_print_internet_state(connection_internet_state_e state)
+{
+ if (state == CONNECTION_INTERNET_STATE_ONLINE)
+ return "Online";
+
+ return "Offline";
+}
+
static const char *test_print_connection_type(connection_type_e type)
{
switch (type) {
ipv4_address, (ipv6_address ? ipv6_address : "NULL"));
}
+static void test_internet_state_changed_callback(connection_internet_state_e state, void* user_data)
+{
+ printf("Internet state changed callback, state : %d\n", state);
+}
+
static void test_profile_state_callback(connection_profile_state_e state, void* user_data)
{
char *profile_name;
connection_set_proxy_address_changed_cb(connection, test_proxy_changed_callback, NULL);
connection_set_ethernet_cable_state_changed_cb(connection,
test_get_ethernet_cable_state_callback, NULL);
+ connection_set_internet_state_changed_cb(connection, test_internet_state_changed_callback, NULL);
} else {
printf("Client registration failed [%s]\n", test_print_error(err));
return -1;
connection_profile_type_e prof_type;
connection_profile_state_e profile_state;
connection_profile_state_e profile_ipv6_state;
+ connection_internet_state_e internet_state;
connection_profile_h profile;
char *profile_name = NULL;
int address_family = 0;
} else
printf("Profile IPv6 State : %s\n", test_print_state(profile_ipv6_state));
+ if (connection_profile_get_internet_state(profile, &internet_state) != CONNECTION_ERROR_NONE) {
+ printf("Fail to get Internet state\n");
+ return -1;
+ } else
+ printf("Internet State : %s\n", test_print_internet_state(internet_state));
if (connection_profile_get_type(profile, &prof_type) != CONNECTION_ERROR_NONE)
return -1;