Sending data now works. This is done by creating the send data function as a new thread running sideways with the original application and using simple while loops to wait for ack from pentra.