summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-05-19 16:25:31 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-05-22 16:12:09 +0200
commitac8460c77ba51ecb6c2636cdb65169bbb27472c3 (patch)
tree17fa3c547135309fbfd0571e722eae4302762282
parentfd461b0218461b1a2bec20b75cca627fa8935dcf (diff)
layer23: Define sim_pin_required field as bool
-rw-r--r--src/host/layer23/include/osmocom/bb/common/subscriber.h2
-rw-r--r--src/host/layer23/src/common/subscriber.c8
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;
}