Closed realflight1 closed 2 years ago
You are correct. That is something that is not properly handled in the receiver implementation at the moment. Based on the value of IdTypeEnum, it should handle the uasId either as ASCII or binary data. If you have a good suggestions on how to correct this, please upload a Pull Request.
Here's one method/suggestion (courtesy stack overflow) :
import java.nio.ByteBuffer;
import java.util.UUID;
public static UUID getUUIDFromBytes(byte[] bytes) {
ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
Long high = byteBuffer.getLong();
Long low = byteBuffer.getLong();
return new UUID(high, low);
}
This will return a UUID object. The .toString() method will return the "common looking" UUID string in the 4-2-2-2-6 format.
The getUasIdAsString method of the
Identification
class handles all IDs as strings, but according to the ASTM remote ID standard (under BASIC ID MESSAGE 5.4.5.6) UAS ID Type 3 (UTM UUID) should be handled as a 128-bit UUID - binary encoded with network byte order.