response = sender.sendInput("RP", seqnr, 0)
sender.sendReset()
if data == 'DAT?':
- seqnr += 1
print 'DAT: {} sending: a'.format(seqnr)
- response = sender.sendInput('PA', seqnr, sender.lastSeqReceived + 1, 'a')
+ response = sender.sendInput('A', seqnr, sender.lastSeqReceived + 1)
+ response = sender.sendInput('PA', seqnr, sender.lastSeqReceived + 1, data='a\n')
+ seqnr += 2
if response:
+ print 'response: {}'.format(response)
if response == 'Timeout':
print 'data: {} - TIMEOUT!'.format(data)
conn.send('TIMEOUT!\n')
- elif response[0] == 'A':
+ elif response[0] == 'A' or response[0] == 'PA':
print 'data: {} - ACK!'.format(data)
conn.send('ACK!\n')
elif response[0] == 'R':