Skip to content

Commit d6bae0c

Browse files
author
paulz
committed
- disable_recorder extended: checking if it is enabled before disabling (trying to disable if it is disabled leads to crash)
- disable_udp_broadcast implemented git-svn-id: http://isvn/svn/rep_IEP-I000261_LINUX-KERNEL/01_Entwicklung/trunk/10_Entwicklung/28_SW_Komponente_XCOM/30_IMPL/XCOM_Client_Python/dependencies/ixcom-public@11956 fa3a88b2-825e-5648-bb98-bb0d4e3c2968
1 parent 1ee4b9d commit d6bae0c

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

ixcom/parser.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,11 @@ def disable_recorder(self):
785785
ClientTimeoutError: Timeout while waiting for response or log from the XCOM server
786786
ResponseError: The response from the system was not 'OK'.
787787
'''
788-
msgToSend = data.getParameterWithID(data.PARREC_CONFIG_Payload.parameter_id)
789-
msgToSend.payload.data['action'] = data.ParameterAction.CHANGING
790-
self.send_msg_and_waitfor_okay(msgToSend)
788+
currently_enabled = self.get_parameter(data.PARREC_CONFIG_Payload.parameter_id).data['autostart']
789+
if currently_enabled:
790+
msgToSend = data.getParameterWithID(data.PARREC_CONFIG_Payload.parameter_id)
791+
msgToSend.payload.data['action'] = data.ParameterAction.CHANGING
792+
self.send_msg_and_waitfor_okay(msgToSend)
791793

792794
def start_recorder(self, path: str):
793795
'''Start the system recorder
@@ -815,6 +817,32 @@ def stop_recorder(self):
815817
msgToSend.payload.data['action'] = data.ParameterAction.CHANGING
816818
self.send_msg_and_waitfor_okay(msgToSend)
817819

820+
def disable_udp_broadcast(self):
821+
'''Stop the UDP broadcast
822+
823+
Raises:
824+
ClientTimeoutError: Timeout while waiting for response or log from the XCOM server
825+
ResponseError: The response from the system was not 'OK'.
826+
'''
827+
828+
currently_enabled = self.get_parameter(data.PARXCOM_UDPCONFIG_Payload.parameter_id).data['enable']
829+
830+
if currently_enabled:
831+
curr_ip = self.get_parameter(data.PARXCOM_UDPCONFIG_Payload.parameter_id).data['ip']
832+
curr_port = self.get_parameter(data.PARXCOM_UDPCONFIG_Payload.parameter_id).data['port']
833+
curr_ch = self.get_parameter(data.PARXCOM_UDPCONFIG_Payload.parameter_id).data['channel']
834+
835+
msgToSend = data.getParameterWithID(data.PARXCOM_UDPCONFIG_Payload.parameter_id)
836+
msgToSend.payload.data['ip'] = curr_ip
837+
msgToSend.payload.data['port'] = curr_port
838+
msgToSend.payload.data['enable'] = 0
839+
msgToSend.payload.data['channel'] = curr_ch
840+
msgToSend.payload.data['enableABD'] = 0
841+
msgToSend.payload.data['reserved2'] = 0
842+
843+
msgToSend.payload.data['action'] = data.ParameterAction.CHANGING
844+
self.send_msg_and_waitfor_okay(msgToSend)
845+
818846
def set_recorder_suffix(self, suffix: str):
819847
'''Sets the suffix of the system recorder
820848

0 commit comments

Comments
 (0)