On 31/03/2019 19:40, Bill Somerville wrote:
On 31/03/2019 19:17, Ed Stokes wrote:
Here’s what the dg.Data looks like for sub Clear(0)


But, alas, nothing happens with the WSJT-X application.

So, I must still be missing something!

Hi Ed,

that looks fine to me. What version is the WSJT-X you are using? The Clear UDP message was introduced in v2.0.1.

73
Bill
G4WJS.

Hi Ed,

sorry for the delay getting back to you.

There are actually two remaining issues, both my fault.

Firstly a minor one, you must call BinaryStream.Close after all data has been written. Without this the MemoryBlock instance that is being written to may be longer than the sum of the bytes written to the BinaryStream instance, this is because MemoryBlock grows in chunks for efficiency. BinaryStreamClose truncates the underlying MemoryBlock contents to exactly the bytes written. This issue does not cause the problem you are seeing but you should not be writing datagrams longer than intended since that may confuse WSJT-X.

Secondly, and more seriously, the 'id' field sent in messages to WSJT-X must be the same 'id' that originally came from that WSJT-X instance. This is a bug as the id is meant identify the sender of the message, not the recipient. I will update the WSJT-X application to no longer make this erroneous and unnecessary check. You can work around this by setting the id in the outgoing datagram to that received earlier from WSJT-X, e.g. "WSJT-X" for a default instance of WSJT-X.

In your Clear method you would replace:

outputStream.WriteUInt32 (&hffffffff)

with:

Dim utf8 As String = id.ConvertEncoding (Encodings.UTF8)
outputStream.WriteUInt32 (LenB (utf8))
outputStream.Write (utf8)

where 'id' is the id field extracted from a previous incoming WSJT-X message.

Sorry for any confusion, serves me right for not testing the code examples I suggested.

73
Bill
G4WJS.

_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to