rfemu_amarisoft: handle exception and log event if WS is closed

the WS is closed if the eNB process dies. this patch will log an
event but not stop the experiment.

Change-Id: I0fafc7e38954400540375d51813e96500700f50c
This commit is contained in:
Andre Puschmann 2020-08-24 18:18:20 +02:00
parent 58422c5e87
commit d899cf4b4e
1 changed files with 9 additions and 5 deletions

View File

@ -53,11 +53,15 @@ class RFemulationAmarisoftCtrl(RFemulation):
def set_attenuation(self, db):
msg = { "message": "cell_gain", "cell_id": int(self.cell_id), "gain": -db }
msg_str = json.dumps(msg)
self.dbg('sending CTRL msg: "%s"' % msg_str)
self.ws.send(msg_str)
self.dbg('waiting CTRL recv...')
result = self.ws.recv()
self.dbg('Received CTRL msg: "%s"' % result)
try:
self.dbg('sending CTRL msg: "%s"' % msg_str)
self.ws.send(msg_str)
self.dbg('waiting CTRL recv...')
result = self.ws.recv()
self.dbg('Received CTRL msg: "%s"' % result)
except Exception:
log.Error('Error sending CTLR msg to eNB. eNB still running?')
pass
def get_max_attenuation(self):
return 200 # maximum cell_gain value in Amarisoft