aboutsummaryrefslogtreecommitdiff
path: root/broadcast.py
diff options
context:
space:
mode:
authorGrissess <grissess@nexusg.org>2015-06-14 04:30:59 -0400
committerGrissess <grissess@nexusg.org>2015-06-14 04:30:59 -0400
commitb3606eb073651b92a7f3ba7df56d6a7d697bcc13 (patch)
treeec18209d58b63f18cbaaa7aaaed093ec2fe3627e /broadcast.py
parent0e2f4d381644e062b840ec27cecd18e43b0c94be (diff)
Added a major packet type and cleaned up
Diffstat (limited to 'broadcast.py')
-rw-r--r--broadcast.py10
1 files changed, 8 insertions, 2 deletions
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)