mirror of git://git.sysmocom.de/ofono
emulator: Improve SLC establishment logic
This commit is contained in:
parent
d292e0e0ed
commit
0727da1d5b
|
@ -636,7 +636,8 @@ done:
|
||||||
|
|
||||||
g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
|
g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
|
||||||
|
|
||||||
em->slc = TRUE;
|
__ofono_emulator_slc_condition(em,
|
||||||
|
OFONO_EMULATOR_SLC_CONDITION_CMER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1266,3 +1267,31 @@ void __ofono_emulator_set_indicator_forced(struct ofono_emulator *em,
|
||||||
ind->deferred = TRUE;
|
ind->deferred = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __ofono_emulator_slc_condition(struct ofono_emulator *em,
|
||||||
|
enum ofono_emulator_slc_condition cond)
|
||||||
|
{
|
||||||
|
if (em->slc == TRUE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (cond) {
|
||||||
|
case OFONO_EMULATOR_SLC_CONDITION_CMER:
|
||||||
|
if ((em->r_features & HFP_HF_FEATURE_3WAY) &&
|
||||||
|
(em->l_features & HFP_AG_FEATURE_3WAY))
|
||||||
|
return;
|
||||||
|
/* Fall Through */
|
||||||
|
|
||||||
|
case OFONO_EMULATOR_SLC_CONDITION_CHLD:
|
||||||
|
if ((em->r_features & HFP_HF_FEATURE_HF_INDICATORS) &&
|
||||||
|
(em->l_features & HFP_HF_FEATURE_HF_INDICATORS))
|
||||||
|
return;
|
||||||
|
/* Fall Through */
|
||||||
|
|
||||||
|
case OFONO_EMULATOR_SLC_CONDITION_BIND:
|
||||||
|
ofono_info("SLC reached");
|
||||||
|
em->slc = TRUE;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -505,8 +505,17 @@ void __ofono_gprs_provision_free_settings(
|
||||||
int count);
|
int count);
|
||||||
|
|
||||||
#include <ofono/emulator.h>
|
#include <ofono/emulator.h>
|
||||||
|
|
||||||
|
enum ofono_emulator_slc_condition {
|
||||||
|
OFONO_EMULATOR_SLC_CONDITION_CMER,
|
||||||
|
OFONO_EMULATOR_SLC_CONDITION_CHLD,
|
||||||
|
OFONO_EMULATOR_SLC_CONDITION_BIND,
|
||||||
|
};
|
||||||
|
|
||||||
void __ofono_emulator_set_indicator_forced(struct ofono_emulator *em,
|
void __ofono_emulator_set_indicator_forced(struct ofono_emulator *em,
|
||||||
const char *name, int value);
|
const char *name, int value);
|
||||||
|
void __ofono_emulator_slc_condition(struct ofono_emulator *em,
|
||||||
|
enum ofono_emulator_slc_condition cond);
|
||||||
|
|
||||||
#include <ofono/gnss.h>
|
#include <ofono/gnss.h>
|
||||||
#include <ofono/cdma-sms.h>
|
#include <ofono/cdma-sms.h>
|
||||||
|
|
|
@ -3304,6 +3304,10 @@ static void emulator_chld_cb(struct ofono_emulator *em,
|
||||||
|
|
||||||
ofono_emulator_send_info(em, buf, TRUE);
|
ofono_emulator_send_info(em, buf, TRUE);
|
||||||
result.type = OFONO_ERROR_TYPE_NO_ERROR;
|
result.type = OFONO_ERROR_TYPE_NO_ERROR;
|
||||||
|
|
||||||
|
__ofono_emulator_slc_condition(em,
|
||||||
|
OFONO_EMULATOR_SLC_CONDITION_CHLD);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OFONO_EMULATOR_REQUEST_TYPE_QUERY:
|
case OFONO_EMULATOR_REQUEST_TYPE_QUERY:
|
||||||
|
|
Loading…
Reference in New Issue