mirror of
https://github.com/ShaYmez/pYSFReflector.git
synced 2025-07-19 07:25:16 -04:00
Update YSFReflector
Fixed problem with MMDVM_Bridge (callsign filled with chr (0))
This commit is contained in:
parent
b1ed2436f8
commit
01ba4a4fa6
19
YSFReflector
19
YSFReflector
@ -319,6 +319,22 @@ def ReadConfig(f,p):
|
|||||||
p.append(file_rotate) # 8
|
p.append(file_rotate) # 8
|
||||||
|
|
||||||
|
|
||||||
|
def sanitize_msg(data):
|
||||||
|
bya_msg = bytearray(data)
|
||||||
|
|
||||||
|
if (data[0:4] == b"YSFP"):
|
||||||
|
for i in range(10):
|
||||||
|
if (bya_msg[i+4] == 0):
|
||||||
|
bya_msg[i+4] = 32
|
||||||
|
|
||||||
|
if (data[0:4] == b"YSFD"):
|
||||||
|
for i in range(30):
|
||||||
|
if (bya_msg[i+4] == 0):
|
||||||
|
bya_msg[i+4] = 32
|
||||||
|
|
||||||
|
return(bytes(bya_msg))
|
||||||
|
|
||||||
|
|
||||||
def RunServer(config):
|
def RunServer(config):
|
||||||
global filelog
|
global filelog
|
||||||
global version
|
global version
|
||||||
@ -370,7 +386,8 @@ def RunServer(config):
|
|||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
data,addr = recvPackets.get() # bloccante se coda vuota
|
data_ns, addr = recvPackets.get() # bloccante se coda vuota
|
||||||
|
data = sanitize_msg(data_ns)
|
||||||
cmd = data[0:4]
|
cmd = data[0:4]
|
||||||
if (cmd == b'YSFP'):
|
if (cmd == b'YSFP'):
|
||||||
pres = False
|
pres = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user