Read EF-SPDI and use it for SPN display.
PATCH 1/1 Read EF-SPDI and use it for SPN display.
When the operator is one of those listed in EF-SPDI then we need to treat it like a HPLMN in deciding whether the SPN or PLMN name should be displayed.
---
I was also going to try implementing the semantics described in EF-PNN / EF-OPL but I have not found evidence that it's not already handled by the modem in the responses to +COPN (i.e. it may already be taking care to substitute the network names? is this specified somewhere or would this be very unlikely?)
Regards
--- src/network.c | 7 ++- src/sim.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/sim.h | 3 + 3 files changed, 176 insertions(+), 1 deletions(-)
src/network.c +6 -1
@@ -328,6 +328,7 @@ static char *get_operator_display_name(struct ofono_modem *modem)const char *plmn;char *name = netreg->display_name;int len =sizeof (netreg->display_name); +int home_or_spdi;/* The name displayed to user depends on whether we're in a home * PLMN or roaming and on configuration bits from the SIM, all
@@ -345,7 +346,11 @@ static char *get_operator_display_name(struct ofono_modem *modem) plmn = netreg->current_operator->name; -if (netreg->status ==NETWORK_REGISTRATION_STATUS_REGISTERED ) + home_or_spdi = + (netreg->status ==NETWORK_REGISTRATION_STATUS_REGISTERED ) || +ofono_operator_in_spdi (modem, netreg->current_operator); + +if (home_or_spdi)if (netreg->flags &NETWORK_REGISTRATION_FLAG_HOME_SHOW_PLMN )/* Case 1 */ snprintf (name, len,"%s (%s)" , netreg->spname, plmn);
src/sim.c +167 -0
203 lines not on this page · raw message
src/sim.h +3 -0
@@ -28,3 +28,6 @@ int ofono_spn_update_notify_register(struct ofono_modem *modem, update_spn_cb cb);int ofono_spn_update_notify_unregister (struct ofono_modem *modem,update_spn_cb cb); + +int ofono_operator_in_spdi (struct ofono_modem *modem, +const struct ofono_network_operator *op);
Signature · 1 line
1.6.0
Hi,
Quoted 3 lines
When the operator is one of those listed in EF-SPDI then we need to treat it like a HPLMN in deciding whether the SPN or PLMN name should be displayed.
Patch has been applied. I fixed a couple minor style issues. Thanks.
Quoted 6 lines
---
I was also going to try implementing the semantics described in EF-PNN / EF-OPL but I have not found evidence that it's not already handled by the modem in the responses to +COPN (i.e. it may already be taking care to substitute the network names? is this specified somewhere or would this be very unlikely?)
Unfortunately +COPN is based on the operator list stored in the modem itself. This generally means this list is pretty much garbage after a few years. Check 22.101 Appending A, Section A.3. Basically the +COPS=? lists the operator names stored in the ME, +COPS? is likely to report the NITZ name once it arrives. The SIM EFpnn and EFopl is not queried unless you use vendor extensions.
For us the strategy should probably be:
- If EFpnn / EFopl exists on the SIM, read and cache
- If EFpnn / EFopl exists on the SIM and cache already exists, delay updating cache until later
- If EFpnn / EFopl cache name exists, use that name
- Otherwise use COPS name.
There's also the possibility of including our own database of mcc/mnc identifiers along with operator name and operator country. This would probably have higher precedence over the COPS name.
Regards,
-Denis
Quoted 3 lines · Denis Kenzior
There's also the possibility of including our own database of mcc/mnc identifiers along with operator name and operator country. This would probably have higher precedence over the COPS name.
This would be my preference. I suspect modem vendors would be more than happy to let the that list live somewhere else in the future.
Cheers,
Aki