Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Calculates text response from Huawei E3372 modem SMS in text mode (AT+CMGF=1) to readable one
import sys
def huawei_sms2txt(bytes):
"""
Calculates text response from Huawei E3372 modem SMS in text mode (AT+CMGF=1)
to readable one
"""
return ''.join([
y for e,y in enumerate(chr(int(x,16))
for x in re.findall(r'\w{2}', bytes)) if e % 2 != 0])
if __name__ == "__main__":
huawei_sms2txt(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.