summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-02-24 22:49:39 +0100
committerfixeria <vyanitskiy@sysmocom.de>2021-03-01 15:02:35 +0000
commitf9938b3a5408aa58ccde20f515f48fd15e0664a7 (patch)
tree349fd989f02beb8bea82f94a6faf4735d83a80c3
parent7a31e98936f60356013129366f30a98de034d00d (diff)
trx_toolkit/data_msg.py: decorate abstract methods as such
-rw-r--r--src/target/trx_toolkit/data_msg.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/target/trx_toolkit/data_msg.py b/src/target/trx_toolkit/data_msg.py
index 89fb916d..cafe7a6a 100644
--- a/src/target/trx_toolkit/data_msg.py
+++ b/src/target/trx_toolkit/data_msg.py
@@ -23,6 +23,7 @@
import random
import struct
+import abc
from enum import Enum
from gsm_shared import *
@@ -55,7 +56,7 @@ class Modulation(Enum):
return mod
return None
-class DATAMSG:
+class DATAMSG(abc.ABC):
""" TRXD (DATA) message codec (common part).
The DATA messages are used to carry bursts in both directions
@@ -133,25 +134,25 @@ class DATAMSG:
''' The common header length. '''
return 1 + 4 # (VER + TN) + FN
+ @abc.abstractmethod
def gen_hdr(self):
''' Generate message specific header. '''
- raise NotImplementedError
+ @abc.abstractmethod
def parse_hdr(self, hdr):
''' Parse message specific header. '''
- raise NotImplementedError
+ @abc.abstractmethod
def gen_burst(self):
''' Generate message specific burst. '''
- raise NotImplementedError
+ @abc.abstractmethod
def parse_burst(self, burst):
''' Parse message specific burst. '''
- raise NotImplementedError
+ @abc.abstractmethod
def rand_burst(self):
''' Generate a random message specific burst. '''
- raise NotImplementedError
def rand_fn(self):
''' Generate a random frame number. '''