diff --git a/mtrlog.py b/mtrlog.py index 26e8e38..35652b7 100644 --- a/mtrlog.py +++ b/mtrlog.py @@ -23,13 +23,13 @@ class MtrLogFormatter: '"%s"' % datetime_extracted.strftime('%d.%m.%y %H:%M:%S.000')) log_line.append( '"%02d.%02d.%02d %02d:%02d:%02d.%03d"' % ( - msg.timestamp_day(), - msg.timestamp_month(), - msg.timestamp_year(), - msg.timestamp_hours(), - msg.timestamp_minutes(), - msg.timestamp_seconds(), - msg.timestamp_milliseconds())) + msg.day(), + msg.month(), + msg.year(), + msg.hours(), + msg.minutes(), + msg.seconds(), + msg.milliseconds())) log_line.append('%06d' % msg.card_id()) log_line.append('%04d' % 0) # skipped product week log_line.append('%04d' % 0) # skipped product year diff --git a/mtrreader.py b/mtrreader.py index 7173fe4..88c9dfe 100644 --- a/mtrreader.py +++ b/mtrreader.py @@ -170,25 +170,25 @@ class MtrStatusMessage: def mtr_id(self): return int.from_bytes(self.message_bytes[6:8], 'little') - def timestamp_year(self): + def year(self): return int.from_bytes(self.message_bytes[8:9], 'little') - def timestamp_month(self): + def month(self): return int.from_bytes(self.message_bytes[9:10], 'little') - def timestamp_day(self): + def day(self): return int.from_bytes(self.message_bytes[10:11], 'little') - def timestamp_hours(self): + def hours(self): return int.from_bytes(self.message_bytes[11:12], 'little') - def timestamp_minutes(self): + def minutes(self): return int.from_bytes(self.message_bytes[12:13], 'little') - def timestamp_seconds(self): + def seconds(self): return int.from_bytes(self.message_bytes[13:14], 'little') - def timestamp_milliseconds(self): + def milliseconds(self): return int.from_bytes(self.message_bytes[14:16], 'little') def battery_status(self): @@ -214,25 +214,25 @@ class MtrDataMessage: def mtr_id(self): return int.from_bytes(self.message_bytes[6:8], 'little') - def timestamp_year(self): + def year(self): return int.from_bytes(self.message_bytes[8:9], 'little') - def timestamp_month(self): + def month(self): return int.from_bytes(self.message_bytes[9:10], 'little') - def timestamp_day(self): + def day(self): return int.from_bytes(self.message_bytes[10:11], 'little') - def timestamp_hours(self): + def hours(self): return int.from_bytes(self.message_bytes[11:12], 'little') - def timestamp_minutes(self): + def minutes(self): return int.from_bytes(self.message_bytes[12:13], 'little') - def timestamp_seconds(self): + def seconds(self): return int.from_bytes(self.message_bytes[13:14], 'little') - def timestamp_milliseconds(self): + def milliseconds(self): return int.from_bytes(self.message_bytes[14:16], 'little') def packet_num(self):