diff options
author | Aki Niemi <aki.niemi@nokia.com> | 2010-09-30 10:23:09 +0300 |
---|---|---|
committer | Aki Niemi <aki.niemi@nokia.com> | 2010-09-30 11:25:48 +0300 |
commit | 65091525448462b7729c9e62527b0183c7d0ef1b (patch) | |
tree | 137081d60606526db7564a73993bd25a86bc3a08 /drivers/isimodem/network-registration.c | |
parent | 64120b976a9b1cf187e2f9e19f01462b89cbc53c (diff) | |
download | ofono-65091525448462b7729c9e62527b0183c7d0ef1b.tar.bz2 |
isimodem: Fix signal strength reporting
ISI modems send the signal strength indication before registration
status changes, which causes the core to ignore initial signal
strength values.
Diffstat (limited to 'drivers/isimodem/network-registration.c')
-rw-r--r-- | drivers/isimodem/network-registration.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/isimodem/network-registration.c b/drivers/isimodem/network-registration.c index 4898d42b..6eef99ee 100644 --- a/drivers/isimodem/network-registration.c +++ b/drivers/isimodem/network-registration.c @@ -50,6 +50,7 @@ struct netreg_data { guint8 last_reg_mode; guint8 rat; guint8 gsm_compact; + guint8 strength; }; static inline guint8 *mccmnc_to_bcd(const char *mcc, const char *mnc, @@ -200,6 +201,13 @@ static void reg_status_ind_cb(GIsiClient *client, if (decode_reg_status(nd, msg+3, len-3, &status, &lac, &ci, &tech)) { status = isi_status_to_at_status(status); ofono_netreg_status_notify(netreg, status, lac, ci, tech); + + /* + * Make sure the core is also informed of current + * signal strength, as it can be received before + * registration status. + */ + ofono_netreg_strength_notify(netreg, nd->strength); } } @@ -748,10 +756,12 @@ static void rssi_ind_cb(GIsiClient *client, { const unsigned char *msg = data; struct ofono_netreg *netreg = opaque; + struct netreg_data *nd = ofono_netreg_get_data(netreg); if (!msg || len < 3 || msg[0] != NET_RSSI_IND) return; + nd->strength = msg[1]; ofono_netreg_strength_notify(netreg, msg[1]); } |