Ejemplo n.º 1
0
def rsu2cars(myip):
    print 'sending msg i2v: other cars'
    send(
        {
            'type': 3,
            'rsuID': myip,
            'cars': cars.list(),
            'time': int(time.time())
        }, "all")
Ejemplo n.º 2
0
def sendAction(MYIP, table, gate, control):
	communication.send({
		'id': randomString(),
		'type': 3,
		'to': gate,
		'from': [MYIP],
		'content': control,
		'timestamp': time.time(),
	}, table)
Ejemplo n.º 3
0
def sendBeacons(MYIP, table):
	communication.send({
		'id': randomString(),
		'type': 1,
		'to': 'all',
		'from': [MYIP],
		'content': table,
		'timestamp': time.time(),
	}, table)
Ejemplo n.º 4
0
def car2car(myip):
    print 'sending msg v2v: driver state'
    send(
        {
            'type': 1,
            'carID': myip,
            'location': location.get(),
            'state': driver.state(),
            'time': int(time.time())
        }, "all")
Ejemplo n.º 5
0
def rsu2car(feedback, ip, myip):
    print 'sending msg i2v: feedback'
    send(
        {
            'carID': ip,
            'type': 6,
            'rsuID': myip,
            'feedback': feedback,
            'time': int(time.time())
        }, 'all')
Ejemplo n.º 6
0
def sendCleanTables(MYIP, table):
	led.on('YELLOW_PIN')
	communication.send({
		'id': randomString(),
		'type': 4,
		'to': 'all',
		'from': [MYIP],
		'content': 'clear tables',
		'timestamp': time.time(),
	}, table)
Ejemplo n.º 7
0
def rsu2its(car, state, sensors, myip):
    print 'sending msg i2c: sensors data'
    send(
        {
            'type': 4,
            'rsuID': myip,
            'carID': car,
            'state': state,
            'sensors': sensors,
            'time': int(time.time())
        }, "all")
Ejemplo n.º 8
0
def sendDecoded(MYIP, table, string):
	led.on('GREEN_PIN')
	led.on('RED_PIN')
	communication.send({
		'id': randomString(),
		'type': 2,
		'to': 'fc01::4',
		'from': [MYIP],
		'content': string,
		'timestamp': time.time(),
	}, table)
Ejemplo n.º 9
0
def car2rsu(myip):
    print 'sending msg v2i: sensors data'
    sensors = json.dumps(driver.sensors())
    sensors = cipher(sensors)
    send(
        {
            'type': 2,
            'carID': myip,
            'location': location.get(),
            'state': driver.state(),
            'sensors': sensors,
            'time': int(time.time())
        }, "all")
Ejemplo n.º 10
0
def sendRelay(MYIP, table, msg):
	msg['from'].append(MYIP)
	communication.send(msg, table)