mirror of https://github.com/PentHertz/srsLTE.git
fix home plmn extraction for PCSC USIM module
This commit is contained in:
parent
028b44c1af
commit
2e9a981a8a
|
@ -184,12 +184,12 @@ bool pcsc_usim::get_home_plmn_id(srslte::plmn_id_t* home_plmn_id)
|
|||
plmn_str << (int)imsi_vec[i];
|
||||
}
|
||||
|
||||
if (not home_plmn_id->from_string(plmn_str.str())) {
|
||||
if (home_plmn_id->from_string(plmn_str.str())) {
|
||||
log->error("Error reading home PLMN from SIM.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
log->info("Read Home PLMN Id=%s\n", plmn_str.str().c_str());
|
||||
log->info("Read Home PLMN Id=%s\n", home_plmn_id->to_string().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,15 @@ int main(int argc, char **argv)
|
|||
|
||||
std::string imsi = usim.get_imsi_str();
|
||||
cout << "IMSI: " << imsi << endl;
|
||||
|
||||
srslte::plmn_id_t home_plmn_id = {};
|
||||
if (usim.get_home_plmn_id(&home_plmn_id) == false) {
|
||||
printf("Error reading home PLMN\n");
|
||||
return SRSLTE_ERROR;
|
||||
}
|
||||
|
||||
cout << "Home PLMN: " << home_plmn_id.to_string() << endl;
|
||||
|
||||
auth_result_t result = usim.generate_authentication_response(rand_enb, autn_enb, mcc, mnc, res, &res_len, k_asme);
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue