From b3606eb073651b92a7f3ba7df56d6a7d697bcc13 Mon Sep 17 00:00:00 2001 From: Grissess Date: Sun, 14 Jun 2015 04:30:59 -0400 Subject: Added a major packet type and cleaned up --- broadcast.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'broadcast.py') diff --git a/broadcast.py b/broadcast.py index f244aa6..fe2b466 100644 --- a/broadcast.py +++ b/broadcast.py @@ -5,7 +5,7 @@ import time import xml.etree.ElementTree as ET import threading -from packet import Packet, CMD +from packet import Packet, CMD, itos PORT = 13676 if len(sys.argv) > 2: @@ -32,7 +32,13 @@ except socket.timeout: print 'Clients:' for cl in clients: - print cl + print cl, + s.sendto(str(Packet(CMD.CAPS)), cl) + data, _ = s.recvfrom(4096) + pkt = Packet.FromStr(data) + print 'ports', pkt.data[0], + print 'type', itos(pkt.data[1]), + print 'uid', ''.join([itos(i) for i in pkt.data[2:]]).rstrip('\x00') if sys.argv[1] == '-t': s.sendto(str(Packet(CMD.PLAY, 0, 250000, 440, 255)), cl) time.sleep(0.25) -- cgit v1.2.3-70-g09d2