Project

General

Profile

Revision 170

Added by Brad Neuman over 13 years ago

updated netprog with nicer output (slightly)

View differences:

netprog.py
47 47
    bus = dumbBus() 
48 48

  
49 49
bus.flushInput()
50
#print bus
50
print bus
51 51

  
52 52
def printMsg(msg):
53 53
    if len(msg) < 5:
......
108 108
    msg = bus.read(5)
109 109
    if len(msg) < 5:
110 110
        print "message too short! len =",len(msg)
111
        if len(msg) == 0:
112
            print "probably a timeout"
113
        else:
114
            print "got:",
115
            for i in range(len(msg)):
116
                print (ord(msg[i]))," ",
117
            print 
111 118
        return TT_BAD
112 119
    if msg[0] != '^':
113
        print "did not get start delimeter!"
120
        print "did not get start delimeter! ",ord(msg[0])
114 121
        return TT_BAD
115 122
    src = msg[1]
116 123
    #print "src: ", ord(src)
......
137 144

  
138 145
print "waiting for boot packet..."
139 146
while readPacket() != TT_BOOT:
140
    print "got some other byte ???"
147
    print "Didn't get a boot packet, bailing out"
141 148
    exit(-4)
142 149

  
143 150
sendProgram(toolID, flen)

Also available in: Unified diff