aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-12-01 22:19:25 +0100
committerHarald Welte <laforge@gnumonks.org>2015-12-01 22:19:56 +0100
commit37034411501877940a71ec4c416044f390d25fcb (patch)
tree7e8f52095e5ed021291fc075aa8d8e159b3b40cb
parent9e7356a1a69d095b62e69643e9d118cf57558990 (diff)
mncc_msg(): Add more meaningful string representation
-rw-r--r--mncc_sock.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mncc_sock.py b/mncc_sock.py
index 19dab4c..e99ceb2 100644
--- a/mncc_sock.py
+++ b/mncc_sock.py
@@ -12,6 +12,10 @@ class mncc_msg(mncc.gsm_mncc):
def receive(self, bytes):
fit = min(len(bytes), ctypes.sizeof(self))
ctypes.memmove(ctypes.addressof(self), bytes, fit)
+ def __str__(self):
+ return 'mncc_msg(type=0x%04x, callref=%u, fields=0x%04x)' % (self.msg_type, self.callref, self.fields)
+ def __unicode__(self):
+ return u'mncc_msg(type=0x%04x, callref=%u, fields=0x%04x)' % (self.msg_type, self.callref, self.fields)
def mncc_number(number, num_type = 0, num_plan = 0, num_present = 1, num_screen = 0):
return mncc.gsm_mncc_number(number = number, type = num_type,