Hi Bill,

Thanks for pointing out the MessageAggregator demo code. We looked at
Decodesmodel.cpp and our one simple line of needed data is as below:

1. May be easier to use QT, instead of Microsoft and needing to port a
lot of 'QT things which I never used before' to Microsoft environment.

2. Which version of QT? Where to get it?

3. The MessageAggregator is an independent program, right? There is no
concern for huge dependencies and needing to get all library, etc. if
I were to compile the WHOLE WSJT-X.

void DecodesModel::add_decode (bool is_new, QString const& client_id,
QTime time, qint32 snr, float delta_time
                               , quint32 delta_frequency, QString
const& mode, QString const& message
                               , bool low_confidence, bool off_air,
bool is_fast)

73 Simon VR2UKQ

On 12/6/18, Bill Somerville <g4...@classdesign.com> wrote:
> Hi Simon,
>
> comments in line below.
>
> On 06/12/2018 05:06, Simon wrote:
>> Many thanks for your time. Sorry for very basic questions as I have
>> not done these before.
>>
>> Are below actions correct?  I shall put together a dev environment and
>> start trying it out.
>>
>> 1. Use Microsoft free community version of visual basic or C.
> Ok.
>>
>> 2. Open/connect  winsock to 127.0.0.1, port 2237
> This is UDP, there is no connection. You create a socket and bind to the
> address and port, then join multicast group if you wish to join
> multicast group.
>>
>> 3. I will receive from WSJT-X, once every 15 seconds (as I saw the
>> message_aggregator running), a stream of bytes as defined below
> The datagrams at 15s intervals are Heartbeat messages, the message below
> is a Decode message which is a different message type and is sent
> immediately a decode is printed in WSJT-X.
>>
>>   *   Header format:
>>   *
>>   *      32-bit unsigned integer magic number 0xadbccbda
>>   *      32-bit unsigned integer schema number
>>
>>   * Decode        Out       2                      quint32
>>   *                         Id (unique key)        utf8
>>   *                         New                    bool
>>   *                         Time                   QTime,     quint32
>> Milli-seconds since midnight
>>   *                         snr                    qint32
>>   *                         Delta time (S)         float (serialized as
>> double)
>>   *                         Delta frequency (Hz)   quint32
>>   *                         Mode                   utf8
>>   *                         Message                utf8
>>   *                         Low confidence         bool
>>   *                         Off air                bool
>>
>> What is Id (unique key) ?
> Id identifies the sender, it is a utf8 string in Qt's serialization
> format of a QString type as defined in the Qt QDataStream documentation
> (http://doc.qt.io/qt-5/datastreamformat.html). Basically a 32-bit
> unsigned integer count in network byte order followed by the utf8 code
> points.
>>
>> Is bool one byte, 8 bits, 1 is true?
> yes except zero is false true is everything else, normal C/C++ rules.
>>
>> Is float, ieee single precision float? Same in Microsoft Visual Basic
>> or Visual C?
> As stated above the "on the wire" format is double precision although
> the original variable was a single precision float in WSJT-X. Yes it is
> IEEE format but little endian (doesn't matter on Windows Intel but if
> you want to be platform independent you should swap bytes if your
> machine is BE).
>>
>> https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=2ahUKEwjVqYXMtIrfAhVXMt4KHYGPCj4QFjABegQIBRAE&url=http%3A%2F%2Fwww.cse.hcmut.edu.vn%2F~hungnq%2Fcourses%2F501120%2Fdocthem%2FSingle%2520precision%2520floating-point%2520format%2520-%2520Wikipedia.pdf&usg=AOvVaw1qErt5I2uhO6cVvI6f6em9
>>
>> Message is multiple byte. How do I know it is end of message? There is
>> no "length" field.
> Each field is self describing, you must walk along the data until you
> have extracted the fields you want. In fact you must not assume a
> message length as later versions of WSJT-X may add more fields to an
> existing message type (note that this is not a new schema number, new
> fields are allowed at the same schema number). The datagram will have a
> known size from when you receive it from the network.
>>
>> What is schema number?
> It is described in the NetworkMessage.hpp documentation, you really must
> read and understand that big comment at the top of that header file, it
> has everything you need for this task or links to required reading
> likehttp://doc.qt.io/qt-5/datastreamformat.html. The schema number's
> purpose is to define the "on the wire" format of the low level fields,
> for example if the Qt team decided that QString would be serialized with
> a 64-bit count then that would be a schema number change since all
> receivers of messages would need to know that in advance (this is why
> the schema number is a near the beginning of the message as possible).
> If you receive a message with a higher schema number than the ones your
> program knows about you must ignore the message, OTOH there is a schema
> negotiation protocol which allows any participant in the protocol to
> force the highest schema number that everyone else can use. You can
> choose not to negotiate and just give up if you see a new schema number,
> or you can negotiate and potentially degrade all participants. Its your
> choice. Negotiating involves your application sending Heartbeat messages
> back to each WSJT-X instance that sends them, at least until the schema
> is negotiated
>>
>> The header is as defined above. How do I know where is the end?  For
>> example, if there is two traffic QSO on different audio frequency in
>> one 15 second ft8 decode time cycle, I should receive 2 of the above
>> 'packet of bytes', right?
> They are UDP datagrams, packet is not a good term as it means something
> else in the Internet protocol. As it happens one datagram will be
> contained in one packet, but give them their correct name. UDP is not a
> stream format, it is a "fire and forget" message protocol. Yes there
> will always be one datagram for each message. For example there will be
> one datagram containing a Decode message (type 2) for each and every
> decode printed by every WSJT-X instance.
>>
>> 73
>>
>> Simon VR2UKQ
>
> 73
> Bill
> G4WJS.
>
>


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

Reply via email to