pySim-read.py: Enable reading of EF.IMPU from ISIM

IMS public user identity (IMPU)
As per TS1.103, this EF contains one or more records, with each record able
to hold a public SIP Identity (SIP URI) of the user. EF.IMPI consist of URI TLV data
object values see IETF RFC 3261. The URI shall be encoded to an octet string according
to UTF-8 encoding rules as specified in IETF RFC 3629

Reading of EF.IMPU is achieved by first selecting the ISIM application using its AID.
This is followed by selecting EF.IMPU with File ID - 6f04 in ADF.ISIM

Change-Id: Icf78a564aeaf4254658d3b018ff57dfc4b987e6f
diff --git a/pySim/cards.py b/pySim/cards.py
index 17b7bce..56597b0 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -385,6 +385,20 @@
 		else:
 			return (None, sw)
 
+	def read_impu(self):
+		rec_cnt = self._scc.record_count(EF_ISIM_ADF_map['IMPU'])
+		impu_recs = ""
+		for i in range(0, rec_cnt):
+			(res, sw) = self._scc.read_record(EF_ISIM_ADF_map['IMPU'], i + 1)
+			if sw == '9000':
+				# Skip the inital tag value ('80') byte and get length of contents
+				length = int(res[2:4], 16)
+				content = h2s(res[4:4+(length*2)])
+				impu_recs += "\t%s\n" % (len(content) and content or 'Not available')
+			else:
+				impu_recs += "IMS public user identity: Can't read, response code = %s\n" % (sw)
+		return impu_recs
+
 
 class _MagicSimBase(Card):
 	"""