summaryrefslogtreecommitdiff
path: root/usrp/host/apps/dump_shorts
blob: 6104ea0622981869574c9e91ca2e0ed6a999e2cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
# -*- Python -*-

import sys, errno

counter = 0

try:
    while 1:
        x = sys.stdin.read (2)
        if not x:
            break

        v = (ord(x[1]) << 8) | ord(x[0])
        sys.stdout.write ("0x%08x  %6d  0x%04x\n" % (counter, v, v))
        counter += 1
except IOError, e:
    if e.errno == errno.EPIPE:
        sys.exit (0)