Exemple #1
0
 def receiver():
     data = yield b.framer.recv()
     print 'bytes recv by {}: {}'.format(b, fmt(data, 'hex'))
     data = yield b.framer.recv()
     print 'bytes recv by {}: {}'.format(b, fmt(data, 'hex'))
     print 'bits ever received at {}: {}'.format(
             b.port,
             fmt(utils.unbitify(b.port.bits_received), 'bin'))
     print 'bits ever received at {} (shifted): {}'.format(
             b.port,
             fmt(utils.unbitify(b.port.bits_received[3:]), 'hex'))
     raise mint.Stop
     yield mint.end
Exemple #2
0
 def receiver():
     data = yield b.recv(4)
     print 'Received at {}: {}'.format(mint.env.now, fmt(data, 'hex'))
     print '                {}'.format(fmt(data, 'bin'))
     raise mint.Stop
     yield mint.end