#include <glib.h>
Go to the source code of this file.
Functions | |
void | connect_background_restore_scan_ctxt (void) |
void | connect_background_restore_ping_ctxt (void) |
int | connect_background_get_initial_profile (void) |
void | connect_background_on_connected (int profileIndex) |
void | connect_background_on_failed_all (void) |
Copyright (C) 2007 iRex Technologies BV.
Definition in file connectBackground.h.
int connect_background_get_initial_profile | ( | void | ) |
Definition at line 105 of file connectBackground.c.
00106 { 00107 gint regIndex, profileIndex = 0; 00108 00109 // select last used profile or first profile 00110 regIndex = connect_data_get_last_connected_profile(); 00111 CN_LOGPRINTF ("last connected profile [%d]", regIndex); 00112 00113 if (main_get_use_last_connected () && regIndex >= 0) 00114 { 00115 // convert regIndex in registry into profileIndex in all profiles 00116 profileIndex = connect_data_get_profile_index(regIndex); 00117 CN_LOGPRINTF("regIndex[%d]-->profileIndex[%d]", 00118 regIndex, profileIndex); 00119 if (profileIndex == -1) 00120 { 00121 profileIndex = 0; 00122 } 00123 } 00124 return profileIndex; 00125 }
void connect_background_on_connected | ( | int | profileIndex | ) |
Definition at line 127 of file connectBackground.c.
00128 { 00129 int regIndex = -1; 00130 00131 // remember last successfull profile 00132 if (profileIndex != -1) 00133 { 00134 regIndex = connect_data_get_reg_index(profileIndex); 00135 if (regIndex != -1) 00136 { 00137 connect_data_set_last_connected_profile(regIndex); 00138 } 00139 } 00140 00141 // start child process, if specified 00142 main_start_child_process(); 00143 }
void connect_background_on_failed_all | ( | void | ) |
Definition at line 145 of file connectBackground.c.
00146 { 00147 CN_LOGPRINTF("It's background connection, exit."); 00148 main_quit(); 00149 }
void connect_background_restore_ping_ctxt | ( | void | ) |
Definition at line 60 of file connectBackground.c.
00061 { 00062 pingContext_t *ctxt; 00063 cmgrConnectType_t connectType; 00064 00065 CN_LOGPRINTF("entry"); 00066 00067 ctxt = cmgr_get_ping_ctxt(); 00068 if (ctxt) 00069 { 00070 connect_ping_ctxt_set_mode(ctxt, backgroundPing_e); 00071 connectType = connect_data_get_connect_type(); 00072 connect_ping_ctxt_set_connect_type(ctxt, connectType); 00073 00074 connect_ping_ctxt_set_done_callbacks(ctxt, 00075 connect_background_on_connected, 00076 connect_background_on_failed_all); 00077 00078 connect_ping_ctxt_set_get_initial_profile(ctxt, 00079 connect_background_get_initial_profile); 00080 00081 connect_ping_ctxt_set_access_network_profiles_callbacks(ctxt, 00082 connect_data_get_n_network_profiles, 00083 connect_data_get_network_profile, 00084 connect_data_select_next_regprofile); 00085 } 00086 }
void connect_background_restore_scan_ctxt | ( | void | ) |
Definition at line 37 of file connectBackground.c.
00038 { 00039 scanContext_t *ctxt; 00040 connection_t networkType; 00041 char *ssidList; 00042 00043 CN_LOGPRINTF("entry"); 00044 00045 ctxt = cmgr_get_scan_ctxt(); 00046 if (ctxt) 00047 { 00048 connect_scan_ctxt_set_mode(ctxt, backgroundScan_e); 00049 networkType = connect_data_get_network_type(); 00050 connect_scan_ctxt_set_network_type(ctxt, networkType); 00051 connect_scan_ctxt_set_done_callbacks(ctxt, 00052 connect_data_init_network_profiles, 00053 connect_background_scan_networks_done); 00054 ssidList = connect_data_get_hidden_ssid_list(); 00055 connect_scan_ctxt_set_ssidlist(ctxt, ssidList ? ssidList : ""); 00056 g_free(ssidList); 00057 } 00058 }