trx_toolkit/ctrl_if.py: read data from socket in handle_rx()
It makes much more sense to read data from socket in handle_rx(), instead of expecting a buffer with received data from caller. Change-Id: I83479c60c54e36a2a7582714a6043090585957ae
This commit is contained in:
parent
7e9821f289
commit
1dcc45beff
|
@ -27,7 +27,11 @@ import logging as log
|
||||||
from udp_link import UDPLink
|
from udp_link import UDPLink
|
||||||
|
|
||||||
class CTRLInterface(UDPLink):
|
class CTRLInterface(UDPLink):
|
||||||
def handle_rx(self, data, remote):
|
def handle_rx(self):
|
||||||
|
# Read data from socket
|
||||||
|
data, remote = self.sock.recvfrom(128)
|
||||||
|
data = data.decode()
|
||||||
|
|
||||||
if not self.verify_req(data):
|
if not self.verify_req(data):
|
||||||
log.error("Wrong data on CTRL interface")
|
log.error("Wrong data on CTRL interface")
|
||||||
return
|
return
|
||||||
|
|
|
@ -112,13 +112,11 @@ class Application(ApplicationBase):
|
||||||
|
|
||||||
# CTRL commands from BTS
|
# CTRL commands from BTS
|
||||||
if self.bts_ctrl.sock in r_event:
|
if self.bts_ctrl.sock in r_event:
|
||||||
data, addr = self.bts_ctrl.sock.recvfrom(128)
|
self.bts_ctrl.handle_rx()
|
||||||
self.bts_ctrl.handle_rx(data.decode(), addr)
|
|
||||||
|
|
||||||
# CTRL commands from BB
|
# CTRL commands from BB
|
||||||
if self.bb_ctrl.sock in r_event:
|
if self.bb_ctrl.sock in r_event:
|
||||||
data, addr = self.bb_ctrl.sock.recvfrom(128)
|
self.bb_ctrl.handle_rx()
|
||||||
self.bb_ctrl.handle_rx(data.decode(), addr)
|
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
log.info("Shutting down...")
|
log.info("Shutting down...")
|
||||||
|
|
Loading…
Reference in New Issue