sa_inputfile_release_resource(&config);
- sa_inputfile_clear_completion_flag();
- sa_inputfile_remove();
+ if ((sa_inputfile_get_completion_flag(SA_FILE_CONFIG_ETHERNET) && sa_inputfile_get_completion_flag(SA_FILE_CONFIG_WIFI))
+ && (sa_inputfile_get_completion_flag(SA_FILE_CONFIG_SYSTEM))) {
+ _D("Setting is done clear all");
+ sa_inputfile_clear_completion_flag();
+ sa_inputfile_remove();
+ }
}
static GSourceFuncs SourceFuncs = {
static int __eth_update_ip(sa_eth_s * info)
{
- int rv = 0;
+ int ret = 0;
connection_profile_type_e prof_type;
connection_profile_h profile;
return -1;
}
- if (connection_profile_get_type(profile, &prof_type) != CONNECTION_ERROR_NONE) {
- _D("profile connection error!! \n");
+ // If ethernet cable is detached, it should be retried after rebooting.
+ // return 1 is retry case, 0 is non-error and -1 is error to be completed
+ ret = connection_profile_get_type(profile, &prof_type);
+ if (ret == CONNECTION_ERROR_INVALID_PARAMETER) {
+ _D("profile connection error!! [%d]", ret);
+ return 1;
+ } else if (ret != CONNECTION_ERROR_NONE) {
return -1;
}
}
_D("operation sucess\n");
- return 1;
+ return ret;
}
static int __eth_register_client(void)
static int __ethernet_connect_main(sa_eth_s * info)
{
+ int ret = 0;
+
if (info == NULL)
return -1;
if (__eth_register_client() == 1) {
- __eth_update_ip(info);
+ ret = __eth_update_ip(info);
__eth_deregister_client();
} else
_D("connection error!!!\n");
- return 0;
+ return ret;
}
static int __network_get_wifi_state(connection_h connection, connection_wifi_state_e * wifi_state)
if ((info->eth->enabled == TRUE) && !sa_inputfile_get_completion_flag(SA_FILE_CONFIG_ETHERNET)) {
retEth = __ethernet_connect_main(info->eth);
_D("return ethernet [%d]", retEth);
+ if (retEth == 1)
+ _D("retry after rebooting, do not remove completion flag");
+ else
+ sa_inputfile_set_completion_flag(SA_FILE_CONFIG_ETHERNET);
+ } else {
+ // if eth info is null, ethernet completion flag is set
+ sa_inputfile_set_completion_flag(SA_FILE_CONFIG_ETHERNET);
}
+ } else {
+ // if eth info is null, ethernet completion flag is set
+ sa_inputfile_set_completion_flag(SA_FILE_CONFIG_ETHERNET);
}
- sa_inputfile_set_completion_flag(SA_FILE_CONFIG_ETHERNET);
if (info->wifi != NULL) {
if ((info->wifi->enabled == TRUE) && !sa_inputfile_get_completion_flag(SA_FILE_CONFIG_WIFI)) {