diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2013-01-07 11:22:08 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2013-01-07 11:22:08 +0100 |
commit | f6b52d74ddeed108c1f24e906c54fd3db03aae5d (patch) | |
tree | 00d885d2364b6eb7a41aa6f20ca9c67f40008f73 /src/host/layer23/src/mobile/subscriber.c | |
parent | 25c5e8221d94a7a5885d3bcd38d35da86bf17313 (diff) |
mobile: Allow test card to be maked as already attached
This way it is possible to use test card without making attachment
to the network, if the LAI matches. It can be used to do faster
testing.
Diffstat (limited to 'src/host/layer23/src/mobile/subscriber.c')
-rw-r--r-- | src/host/layer23/src/mobile/subscriber.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/host/layer23/src/mobile/subscriber.c b/src/host/layer23/src/mobile/subscriber.c index cefc8556..c2a0af7f 100644 --- a/src/host/layer23/src/mobile/subscriber.c +++ b/src/host/layer23/src/mobile/subscriber.c @@ -161,7 +161,7 @@ int gsm_subscr_exit(struct osmocom_ms *ms) /* Attach test card, no SIM must be currently attached */ int gsm_subscr_testcard(struct osmocom_ms *ms, uint16_t mcc, uint16_t mnc, - uint16_t lac, uint32_t tmsi) + uint16_t lac, uint32_t tmsi, uint8_t imsi_attached) { struct gsm_settings *set = &ms->settings; struct gsm_subscriber *subscr = &ms->subscr; @@ -187,7 +187,11 @@ int gsm_subscr_testcard(struct osmocom_ms *ms, uint16_t mcc, uint16_t mnc, subscr->sim_type = GSM_SIM_TYPE_TEST; sprintf(subscr->sim_name, "test"); subscr->sim_valid = 1; - subscr->ustate = GSM_SIM_U2_NOT_UPDATED; + if (imsi_attached && set->test_rplmn_valid) { + subscr->imsi_attached = imsi_attached; + subscr->ustate = GSM_SIM_U1_UPDATED; + } else + subscr->ustate = GSM_SIM_U2_NOT_UPDATED; subscr->acc_barr = set->test_barr; /* we may access barred cell */ subscr->acc_class = 0xffff; /* we have any access class */ subscr->plmn_valid = set->test_rplmn_valid; @@ -212,6 +216,8 @@ int gsm_subscr_testcard(struct osmocom_ms *ms, uint16_t mcc, uint16_t mnc, gsm_get_mnc(mcc, mnc)); else LOGP(DMM, LOGL_INFO, "-> Test card not registered\n"); + if (subscr->imsi_attached) + LOGP(DMM, LOGL_INFO, "-> Test card attached\n"); /* insert card */ nmsg = gsm48_mmr_msgb_alloc(GSM48_MMR_REG_REQ); |