forked from public/pysim
utils.py: Add helper method to convert a hex string into array of N bytes string elements
Change-Id: I3af080726079729eae92af183de40dfc70c9390e
This commit is contained in:
@@ -128,6 +128,9 @@ def hexstr_to_fivebytearr(s):
|
|||||||
def hexstr_to_threebytearr(s):
|
def hexstr_to_threebytearr(s):
|
||||||
return [s[i:i+6] for i in range(0, len(s), 6) ]
|
return [s[i:i+6] for i in range(0, len(s), 6) ]
|
||||||
|
|
||||||
|
def hexstr_to_Nbytearr(s, nbytes):
|
||||||
|
return [s[i:i+(nbytes*2)] for i in range(0, len(s), (nbytes*2)) ]
|
||||||
|
|
||||||
# Accepts hex string representing three bytes
|
# Accepts hex string representing three bytes
|
||||||
def dec_mcc_from_plmn(plmn):
|
def dec_mcc_from_plmn(plmn):
|
||||||
ia = h2i(plmn)
|
ia = h2i(plmn)
|
||||||
|
|||||||
Reference in New Issue
Block a user