python/trx: follow GNU Radio class naming conventions

This commit is contained in:
Vadim Yanitskiy 2017-10-17 06:52:01 +07:00 committed by Piotr Krysik
parent 52917b1034
commit 873e44e68d
5 changed files with 9 additions and 9 deletions

View File

@ -22,9 +22,9 @@
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from grgsm import UDPLink from grgsm.trx import udp_link
class CTRLInterface(UDPLink): class ctrl_if(udp_link):
def handle_rx(self, data): def handle_rx(self, data):
if self.verify_req(data): if self.verify_req(data):
request = self.prepare_req(data) request = self.prepare_req(data)

View File

@ -22,12 +22,12 @@
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from ctrl_if import CTRLInterface from ctrl_if import ctrl_if
class CTRLInterfaceBB(CTRLInterface): class ctrl_if_bb(ctrl_if):
def __init__(self, remote_addr, remote_port, bind_port, tb, pm): def __init__(self, remote_addr, remote_port, bind_port, tb, pm):
print("[i] Init CTRL interface") print("[i] Init CTRL interface")
CTRLInterface.__init__(self, remote_addr, remote_port, bind_port) ctrl_if.__init__(self, remote_addr, remote_port, bind_port)
# Set link to the follow graph (top block) # Set link to the follow graph (top block)
self.tb = tb self.tb = tb
@ -36,7 +36,7 @@ class CTRLInterfaceBB(CTRLInterface):
def shutdown(self): def shutdown(self):
print("[i] Shutdown CTRL interface") print("[i] Shutdown CTRL interface")
CTRLInterface.shutdown(self) ctrl_if.shutdown(self)
def parse_cmd(self, request): def parse_cmd(self, request):
# Power control # Power control

View File

@ -24,7 +24,7 @@
from random import randint from random import randint
class FakePM: class fake_pm:
# Freq. list for good power level # Freq. list for good power level
bts_list = [] bts_list = []

View File

@ -32,7 +32,7 @@ from math import pi
from gnuradio import blocks from gnuradio import blocks
from gnuradio import gr from gnuradio import gr
class RadioInterface(gr.top_block): class radio_if(gr.top_block):
# PHY specific variables # PHY specific variables
samp_rate = 2000000 samp_rate = 2000000
shiftoff = 400e3 shiftoff = 400e3

View File

@ -25,7 +25,7 @@
import socket import socket
import select import select
class UDPLink: class udp_link:
def __init__(self, remote_addr, remote_port, bind_port): def __init__(self, remote_addr, remote_port, bind_port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sock.bind(('0.0.0.0', bind_port)) self.sock.bind(('0.0.0.0', bind_port))