mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-29 16:50:13 +01:00
2019-08-26 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in the 'pypad_xds.py' PyPAD script that caused an infinite loop.
This commit is contained in:
@@ -19018,3 +19018,6 @@
|
|||||||
2019-08-26 Fred Gleason <fredg@paravelsystems.com>
|
2019-08-26 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Fixed a bug in the 'pypad_walltime.py' PyPAD script that caused
|
* Fixed a bug in the 'pypad_walltime.py' PyPAD script that caused
|
||||||
an infinite loop.
|
an infinite loop.
|
||||||
|
2019-08-26 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Fixed a bug in the 'pypad_xds.py' PyPAD script that caused
|
||||||
|
an infinite loop.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Send CICs via UDP or serial
|
# Send CICs via UDP or serial
|
||||||
#
|
#
|
||||||
# (C) Copyright 2018 Fred Gleason <fredg@paravelsystems.com>
|
# (C) Copyright 2018-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License version 2 as
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -61,31 +61,30 @@ def FilterField(string):
|
|||||||
|
|
||||||
def ProcessPad(update):
|
def ProcessPad(update):
|
||||||
n=1
|
n=1
|
||||||
while(True):
|
section='Udp'+str(n)
|
||||||
section='Udp'+str(n)
|
while(update.config().has_section(section)):
|
||||||
try:
|
if update.shouldBeProcessed(section) and update.hasPadType(pypad.TYPE_NOW) and update.hasService():
|
||||||
if update.shouldBeProcessed(section) and update.hasPadType(pypad.TYPE_NOW) and update.hasService():
|
packet='0:'+update.serviceProgramCode()+':'+update.config().get(section,'IsciPrefix')+FilterField(update.padField(pypad.TYPE_NOW,pypad.FIELD_EXTERNAL_EVENT_ID))+':*'
|
||||||
packet='0:'+update.serviceProgramCode()+':'+update.config().get(section,'IsciPrefix')+FilterField(update.padField(pypad.TYPE_NOW,pypad.FIELD_EXTERNAL_EVENT_ID))+':*'
|
try:
|
||||||
try:
|
#
|
||||||
#
|
# Use serial output
|
||||||
# Use serial output
|
#
|
||||||
#
|
tty_dev=update.config().get(section,'TtyDevice')
|
||||||
tty_dev=update.config().get(section,'TtyDevice')
|
speed=int(update.config().get(section,'TtySpeed'))
|
||||||
speed=int(update.config().get(section,'TtySpeed'))
|
parity=serial.PARITY_NONE
|
||||||
parity=serial.PARITY_NONE
|
dev=serial.Serial(tty_dev,speed,parity=parity,bytesize=8)
|
||||||
dev=serial.Serial(tty_dev,speed,parity=parity,bytesize=8)
|
dev.write(packet.encode('utf-8'))
|
||||||
dev.write(packet.encode('utf-8'))
|
dev.close()
|
||||||
dev.close()
|
|
||||||
|
|
||||||
except configparser.NoOptionError:
|
except configparser.NoOptionError:
|
||||||
#
|
#
|
||||||
# Use UDP output
|
# Use UDP output
|
||||||
#
|
#
|
||||||
send_sock.sendto(packet.encode('utf-8'),
|
send_sock.sendto(packet.encode('utf-8'),
|
||||||
(update.config().get(section,'IpAddress'),int(update.config().get(section,'UdpPort'))))
|
(update.config().get(section,'IpAddress'),int(update.config().get(section,'UdpPort'))))
|
||||||
n=n+1
|
n=n+1
|
||||||
except configparser.NoSectionError:
|
section='Udp'+str(n)
|
||||||
return
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# 'Main' function
|
# 'Main' function
|
||||||
|
|||||||
Reference in New Issue
Block a user