Warning: Can't synchronize with repository "(default)" (No changeset 96d22ec3fa3ef6de3ea8dc0d7d398adc9aa071cf in the repository). Look in the Trac log for more information.

Ticket #465 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

org.freesmartphone.GSM.Network.GetStatus lists no Provider

Reported by: michael Owned by: mickey
Priority: major Milestone:
Component: framework/ogsmd Version: milestone5.5
Keywords: Cc:

Description

AT-Command Interpreter ready
at+COPS=3,0;+COPS?;+COPS=3,2;+COPS?
at+COPS=3,0;+COPS?;+COPS=3,2;+COPS?
+COPS: 0,0," "

+COPS: 0,2,"26201"

OK

the modem return only a string with one withspace, with this little change the Provider is shown.

diff --git a/framework/subsystems/ogsmd/modems/abstract/mediator.py b/framework/subsystems/ogsmd/modems/abstract/mediator.py
index 573f2ab..a2c38ce 100644
--- a/framework/subsystems/ogsmd/modems/abstract/mediator.py
+++ b/framework/subsystems/ogsmd/modems/abstract/mediator.py
@@ -1251,7 +1251,7 @@ class NetworkGetStatus( NetworkMediator ):
                     result["code"] = mccmnc
                     # Some providers' name may be unknown to the modem hence not show up in +COPS=3,0;+COPS?
                     # In this case try to gather the name from our network database
-                    if not "provider" in result:
+                    if not result["provider"].strip():
                         network = const.NETWORKS.get( ( int( mccmnc[:3]), int( mccmnc[3:] ) ), {} )
                         if "brand" in network:
                             result["provider"] = network["brand"]

Change History

comment:1 Changed 5 years ago by mickey

  • Status changed from new to closed
  • Resolution set to fixed

fixed (slightly differently to cover all cases) in [ff1242d731be7dab19a1d6781200803993d42c5d]. thanks!

Note: See TracTickets for help on using tickets.