aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-05-25 04:33:53 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-29 20:30:06 +0000
commit8c7477f5d8244f1ee48676dffd67701033078fbb (patch)
treedfc7e9196afdfa38f0da1c1df4a5636a0a47f621
parent0cc53ef4bc2c7c69c62e71401a16bfefe2f23fce (diff)
cosmetic: SMS tokens: add modem name to SMS message
-rw-r--r--src/osmo_gsm_tester/ofono_client.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py
index c5ae1ff..ce937d0 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -340,9 +340,13 @@ class Modem(log.Origin):
self.set_online()
event_loop.wait(self, self.dbus.has_interface, I_NETREG, I_SMS, timeout=10)
- def sms_send(self, to_msisdn, *tokens):
- if hasattr(to_msisdn, 'msisdn'):
- to_msisdn = to_msisdn.msisdn
+ def sms_send(self, to_msisdn_or_modem, *tokens):
+ if isinstance(to_msisdn_or_modem, Modem):
+ to_msisdn = to_msisdn_or_modem.msisdn
+ tokens = list(tokens)
+ tokens.append('to ' + to_msisdn_or_modem.name())
+ else:
+ to_msisdn = str(to_msisdn_or_modem)
sms = Sms(self.msisdn, to_msisdn, 'from ' + self.name(), *tokens)
self.log('sending sms to MSISDN', to_msisdn, sms=sms)
mm = self.dbus.interface(I_SMS)