fix group SMS for Motorola, fix typo

This commit is contained in:
KF7EEL 2020-11-29 15:36:44 -08:00
parent 4beaf3000d
commit d202f4d0ce

View File

@ -172,6 +172,7 @@ def process_sms(from_id, sms):
if sms in cmd_list: if sms in cmd_list:
logger.info('Executing command/script.') logger.info('Executing command/script.')
os.popen(cmd_list[sms]).read() os.popen(cmd_list[sms]).read()
packet_assembly = ''
except: except:
logger.info('Exception. Command possibly not in list, or other error.') logger.info('Exception. Command possibly not in list, or other error.')
packet_assembly = '' packet_assembly = ''
@ -281,14 +282,14 @@ class DATA_SYSTEM(HBSYSTEM):
# Assume this is an SMS message # Assume this is an SMS message
if '$GPRMC' not in final_packet: if '$GPRMC' not in final_packet:
# Motorola type SMS header # Motorola type SMS header
if '024' in hdr_start: if '824' in hdr_start or '024' in hdr_start:
logger.info('\nMotorola type SMS') logger.info('\nMotorola type SMS')
sms = codecs.decode(bytes.fromhex(''.join(sms_hex[74:-8].split('00'))), 'utf-8') sms = codecs.decode(bytes.fromhex(''.join(sms_hex[74:-8].split('00'))), 'utf-8')
logger.info('\n\n' + 'Received SMS from ' + str(get_alias(int_id(_rf_src), subscriber_ids)) + ', DMR ID: ' + str(int_id(_rf_src)) + ': ' + str(sms) + '\n') logger.info('\n\n' + 'Received SMS from ' + str(get_alias(int_id(_rf_src), subscriber_ids)) + ', DMR ID: ' + str(int_id(_rf_src)) + ': ' + str(sms) + '\n')
process_sms(_rf_src, sms) process_sms(_rf_src, sms)
packet_assembly = '' packet_assembly = ''
else: else:
logger.info('Unknown tpye SMS') logger.info('Unknown type SMS')
logger.info(final_packet) logger.info(final_packet)
packet_assembly = '' packet_assembly = ''
pass pass