trx_toolkit/data_msg.py: decorate abstract methods as such

Change-Id: I27fdcfdabc2b5318ab3e958d2e5446e670fe9035
Related: OS#4006, SYS#4895
This commit is contained in:
Vadim Yanitskiy 2021-02-24 22:49:39 +01:00 committed by fixeria
parent 7a31e98936
commit f9938b3a54
1 changed files with 7 additions and 6 deletions

View File

@ -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. '''