def sync_rx_callback(payload):
    output, tpe, nr = unmake_sync_packet(payload)
    if tpe == "B":
        print "descarded own packet"
    if tpe == "D":
        print "received a sync packet"
        print "sync is now ok"
        mac.sync_nOK = False
Example #2
0
def sync_rx_callback(payload):
    output, tpe, nr = unmake_sync_packet(payload)
    if tpe == 'B':
        print 'descarded own packet'
    if tpe == 'D':
        print 'received a sync packet'
        print 'sync is now ok'
        mac.sync_nOK = False
Example #3
0
def sync_rx_callback(payload):
    output, tpe, nr = unmake_sync_packet(payload)
    if tpe == "B":
        print "descarding own packet"
    if tpe == "D":
        print "received a sync packet"
        print "sync is now ok"
        mac.sync_nOK = False
        f.write("Time-" + time.strftime("%H%M%S") + "-Evnt-" + "slave_got_sync\n")
Example #4
0
def sync_rx_callback(payload):
    output, tpe, nr = unmake_sync_packet(payload)
    if tpe == 'B':
        print 'descarding own packet'
    if tpe == 'D':
        print 'received a sync packet'
        print 'sync is now ok'
        mac.sync_nOK = False
        f.write('Time-' + time.strftime("%H%M%S") + '-Evnt-' +
                'slave_got_sync\n')
def sync_rx_callback(payload):
	output, tpe, nr = unmake_sync_packet(payload)
	if tpe == 'B':
		print 'received a sync packet ' + str(nr)
		f.write('Time-'+time.strftime("%H%M%S") + '-Evnt-' + 'Rxd_sync_packet_nr:' + str(nr) + '\n')
		mac.add_slave_sync_count(nr)
		mac.slave_raw_sync_data[nr] = output
		mac.state = 'sync'
		if all(mac.slave_sync_count):
			mac.new_slave_sync_count()
			mac.sync_nOK = False
			f.write('Time-'+ time.strftime("%H%M%S") + '-Evnt-'+ 'got_sync\n')
	print 'current sync status:', mac.slave_sync_count
	f.write('Time-'+ time.strftime("%H%M%S") + '-Evnt-'+ 'sync_status:' + str(mac.slave_sync_count) + '\n')
Example #6
0
def sync_rx_callback(payload):
    output, tpe, nr = unmake_sync_packet(payload)
    if tpe == 'B':
        print 'received a sync packet' + str(nr)
        f.write('Time-' + time.strftime("%H%M%S") + '-Evnt-' +
                'Rxd_sync_packet_nr:' + str(nr) + '\n')
        mac.add_slave_sync_count(nr)
        mac.slave_raw_sync_data[nr] = output
        mac.state = 'sync'
        if all(mac.slave_sync_count):
            mac.new_slave_sync_count()
            mac.sync_nOK = False
            f.write('Time-' + time.strftime("%H%M%S") + '-Evnt-' +
                    'got_sync\n')
    print 'current sync status:', mac.slave_sync_count
    f.write('Time-' + time.strftime("%H%M%S") + '-Evnt-' + 'sync_status:' +
            str(mac.slave_sync_count) + '\n')
def sync_bench_rx_callback(payload):
	output, tpe, nr = unmake_sync_packet(payload)
	print 'RxD sync packet type: ', tpe,' nr: ', nr