diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-05-19 16:25:31 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-05-22 16:12:09 +0200 |
commit | ac8460c77ba51ecb6c2636cdb65169bbb27472c3 (patch) | |
tree | 17fa3c547135309fbfd0571e722eae4302762282 | |
parent | fd461b0218461b1a2bec20b75cca627fa8935dcf (diff) |
layer23: Define sim_pin_required field as bool
Change-Id: I7c5105da08176f4743f1f3e56ddad9ac170717c7
-rw-r--r-- | src/host/layer23/include/osmocom/bb/common/subscriber.h | 2 | ||||
-rw-r--r-- | src/host/layer23/src/common/subscriber.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/subscriber.h b/src/host/layer23/include/osmocom/bb/common/subscriber.h index e9779e6b..792df629 100644 --- a/src/host/layer23/include/osmocom/bb/common/subscriber.h +++ b/src/host/layer23/include/osmocom/bb/common/subscriber.h @@ -89,7 +89,7 @@ struct gsm_subscriber { /* talk to SIM */ uint8_t sim_state; - uint8_t sim_pin_required; /* state: wait for PIN */ + bool sim_pin_required; /* state: wait for PIN */ uint8_t sim_file_index; uint32_t sim_handle_query; uint32_t sim_handle_update; diff --git a/src/host/layer23/src/common/subscriber.c b/src/host/layer23/src/common/subscriber.c index 5f72f52f..dfd44dcc 100644 --- a/src/host/layer23/src/common/subscriber.c +++ b/src/host/layer23/src/common/subscriber.c @@ -970,7 +970,7 @@ static void subscr_sim_query_cb(struct osmocom_ms *ms, struct msgb *msg) l23_vty_ms_notify(ms, NULL); l23_vty_ms_notify(ms, "Please give PIN for ICCID %s (you have " "%d tries left)\n", subscr->iccid, payload[1]); - subscr->sim_pin_required = 1; + subscr->sim_pin_required = true; break; case SIM_CAUSE_PIN1_BLOCKED: LOGP(DMM, LOGL_NOTICE, "PIN is blocked\n"); @@ -982,14 +982,14 @@ static void subscr_sim_query_cb(struct osmocom_ms *ms, struct msgb *msg) "(you have %d tries left)\n", subscr->iccid, payload[1]); } - subscr->sim_pin_required = 1; + subscr->sim_pin_required = true; break; case SIM_CAUSE_PUC_BLOCKED: LOGP(DMM, LOGL_NOTICE, "PUC is blocked\n"); l23_vty_ms_notify(ms, NULL); l23_vty_ms_notify(ms, "PUC is blocked\n"); - subscr->sim_pin_required = 1; + subscr->sim_pin_required = true; break; default: if (sf->func && !sf->mandatory) { @@ -1013,7 +1013,7 @@ static void subscr_sim_query_cb(struct osmocom_ms *ms, struct msgb *msg) /* if pin was successfully unlocked, then resend request */ if (subscr->sim_pin_required) { - subscr->sim_pin_required = 0; + subscr->sim_pin_required = false; subscr_sim_request(ms); return; } |