org-arl / unet-contrib

Unet user contributions
BSD 3-Clause "New" or "Revised" License
11 stars 15 forks source link

UnetSocket C API receive fails due to outdated fjage C API #78

Closed brodiealexander closed 2 years ago

brodiealexander commented 2 years ago

Testing on both Ubuntu 20.04 LTS and MacOS Ventura beta, the UnetSocket C API can successfully transmit data, but consistently received corrupted data.

Instructions to reproduce:

If the issue is successfully reproduced, and output like this should be observed: Connecting to localhost:1101 Waiting for a Datagram Received a org.arl.unet.DatagramNtf : [0,232,210,31,116,34,127,0,0,] Reception Complete

Potential Solution:

When I perform the above steps to update fjage, my output becomes: Connecting to localhost:1101 Waiting for a Datagram Received a org.arl.unet.DatagramNtf : [1,2,3,4,5,6,7,8,9,] Reception Complete

Which is the correct representation of the data sent.

It is also worth noting that the test for data reception in test_unet.c only checks to make sure the class is equal to org.arl.unet.DatagramNtf, but takes no steps to ensure that the data transmitted is received correctly. This means that even though data transmitted was not being received correctly, the test was passing. This meant that the issue was impossible to spot via testing before shipping the update.