Vadim Yanitskiy has submitted this change and it was merged. Change subject: fake_trx/data_msg.py: use a single unified constructor ......................................................................
fake_trx/data_msg.py: use a single unified constructor There are no message specific initialization parts, excepting the header specific fields setting. Let's us a common constructor, dropping custom fields from its arguments. Change-Id: I13a3e4b2f6a1f443ebe7d809df62736e3c43f56f --- M src/target/fake_trx/data_msg.py 1 file changed, 5 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/target/fake_trx/data_msg.py b/src/target/fake_trx/data_msg.py index 5ee8ed5..045e281 100644 --- a/src/target/fake_trx/data_msg.py +++ b/src/target/fake_trx/data_msg.py @@ -32,9 +32,11 @@ fn = None tn = None - # HACK: Abstract class definition - def __init__(self): - raise NotImplementedError + # Common constructor + def __init__(self, fn = None, tn = None, burst = None): + self.burst = burst + self.fn = fn + self.tn = tn # Generates message specific header def gen_hdr(self): @@ -213,13 +215,6 @@ # Specific message fields pwr = None - def __init__(self, fn = None, tn = None, pwr = None, burst = None): - # Init local variables - self.burst = burst - self.pwr = pwr - self.fn = fn - self.tn = tn - # Validates the message fields def validate(self): # Validate common fields @@ -314,14 +309,6 @@ # Specific message fields rssi = None toa = None - - def __init__(self, fn = None, tn = None, rssi = None, toa = None, burst = None): - # Init local variables - self.burst = burst - self.rssi = rssi - self.toa = toa - self.fn = fn - self.tn = tn # Validates the message fields def validate(self): -- To view, visit https://gerrit.osmocom.org/6989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I13a3e4b2f6a1f443ebe7d809df62736e3c43f56f Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: fixeria/trx Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>