X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=hippotat.git;a=blobdiff_plain;f=hippotat%2Fslip.py;h=f13513787857ce7339f91b9dea9d94051fd200fc;hp=4e841947d53eb4291fbd1c4dc63a46c69f9e616b;hb=389236df4bb2ade1e782e1d20295ffde0ee2226b;hpb=c491fea13a428b0c33df3294b23db7e2773e8dc6 diff --git a/hippotat/slip.py b/hippotat/slip.py index 4e84194..f135137 100644 --- a/hippotat/slip.py +++ b/hippotat/slip.py @@ -12,7 +12,7 @@ def encode(packet): .replace(end, esc + esc_end)) def decode(data): - print('DECODE ', repr(data)) + #print('DECODE ', repr(data)) out = [] for packet in data.split(end): pdata = b'' @@ -27,10 +27,10 @@ def decode(data): #print('ESC... %o' % ck) if ck == esc_esc[0]: pdata += esc elif ck == esc_end[0]: pdata += end - else: raise ValueError('invalid SLIP escape') + else: raise ValueError('invalid SLIP escape 0%o %#x' % (ck, ck)) packet = packet[eix+2 : ] out.append(pdata) - print('DECODED ', repr(out)) + #print('DECODED ', repr(out)) return out # -*- python -*-