#! /usr/bin/env python

import sys
import socket
import time
from array import *

#UDP_IP = "134.79.218.188"
#UDP_IP = "192.168.0.37"
#UDP_IP_LOCAL = "192.168.0.3"
#UDP_IP = "140.181.83.107"
UDP_PORT = 56789

total = len(sys.argv)
if( total != 4):
	print "Usage:" + str(sys.argv[0]) + " linkNode_IP local_IP 1/0"
	sys.exit()

UDP_IP=sys.argv[1]
UDP_IP_LOCAL=sys.argv[2]

sock = socket.socket(socket.AF_INET, # Internet
                     socket.SOCK_DGRAM) # UDP

sock.bind((UDP_IP_LOCAL, UDP_PORT))

if( sys.argv[3] == "1"):
	header = array('B', [3,112])
else:
	header = array('B', [3,113])

print "message:", header
err = sock.sendto(header, (UDP_IP, UDP_PORT))
print err




