Commit 67f8814c authored by root's avatar root

Added more debug-output

parent 13a9f4be
......@@ -7,11 +7,14 @@ import threading
def sendData(channels, sock,serverAddress):
for channel in channels:
print("Sending data for Alfred-Channel: {}".format(channel))
p = subprocess.Popen(['/usr/local/bin/alfred-json','-z','-r',channel, '-f', 'json'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
data, err = p.communicate()
data = json.loads(data.decode("utf-8")).values()
print("Alfred returned {} elements.".format(len(data)))
for d in data:
m=json.dumps(d)
message = json.dumps(["alfred",str(channel), m])
print("Alfred: {}".format(message))
message = gzip.zlib.compress(bytes(message,'UTF-8'))
sock.sendto(message, (serverAddress['ip'], serverAddress['port']))
......@@ -4,10 +4,13 @@ import gzip
import json
import time
import threading
def sendData(interface, sock,serverAddress):
p = subprocess.Popen(['/usr/sbin/batadv-vis','-i',interface,'-f', 'json'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
data, err = p.communicate()
print("Sending batadv-vis-data...")
for line in data.splitlines():
print("Sending line: {}".format(line))
line = line.decode('utf-8')
line = json.loads(line)
message = json.dumps(["batadv-vis", json.dumps(line)])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment