Skip to content

Vendor Defined Telemetry API

API for Extended Telemetry - Vendor Defined

Overview

This API is for Tracker developers who are sophisticated users of the API.

This vendor-oriented API matches the interface of the User-Defined API.

Messages sent using this class will be identified as Vendor data.

Encoding Example

Example minimal program

TestAppEncodeVendorDefinedSimple.cpp
#include <cstdint>
#include <iostream>
using namespace std;

#include "WsprEncoded.h"


int main()
{
    // Create User-Defined Telemetry object for the number of
    // fields you want, maximum of 29 1-bit fields possible.
    WsprMessageTelemetryExtendedVendorDefined<5> codec;

    /////////////////////////////////////////////////////////////////
    // Define telemetry fields
    /////////////////////////////////////////////////////////////////

    // Define tracker-specific telemetry, meant for the tracker
    // author to better understand the operation of the tracker
    // itself, rather than, say, a user deciding telemetry to see.
    codec.DefineField("UptimeMinutes",     0, 3600, 1);
    codec.DefineField("RebootsTodayCount", 0,  100, 1);

    /////////////////////////////////////////////////////////////////
    // Set fields (based on GPS data sourced elsewhere)
    /////////////////////////////////////////////////////////////////

    codec.Set("UptimeMinutes",     95);
    codec.Set("RebootsTodayCount",  2);


    /////////////////////////////////////////////////////////////////
    // Look up channel details for use in encoding
    /////////////////////////////////////////////////////////////////

    // Configure band and channel
    const char *band    = "20m";
    uint16_t    channel = 123;

    // Get channel details
    WsprChannelMap::ChannelDetails cd = WsprChannelMap::GetChannelDetails(band, channel);


    /////////////////////////////////////////////////////////////////
    // Take note of which transmission slot you will send in
    // for use in encoding
    /////////////////////////////////////////////////////////////////

    // this is just an example, you will need to know this based on
    // the behavior of your tracker
    uint8_t slot = 2;


    /////////////////////////////////////////////////////////////////
    // Encode the data in preparation to transmit
    /////////////////////////////////////////////////////////////////

    codec.SetId13(cd.id13);   // "06"
    codec.SetHdrSlot(slot);
    codec.Encode();


    /////////////////////////////////////////////////////////////////
    // Extract the now-encoded WSPR message fields
    /////////////////////////////////////////////////////////////////

    const char *callsign = codec.GetCallsign();   // "006AAH"
    const char *grid4    = codec.GetGrid4();      // "KK13"
    int         powerDbm = codec.GetPowerDbm();   // 30

    cout << "Encoded data"          << endl;
    cout << "------------"          << endl;
    cout << "Callsign: "<< callsign << endl;
    cout << "Grid4   : "<< grid4    << endl;
    cout << "PowerDbm: "<< powerDbm << endl;

    return 0;
}

Output

Encoded data
------------
Callsign: 006AAH
Grid4   : KK13
PowerDbm: 30

Decoding Example

Example minimal program

TestAppDecodeVendorDefinedSimple.cpp
#include <cstdint>
#include <iostream>
using namespace std;

#include "WsprEncoded.h"


int main()
{
    // Create Vendor-Defined Telemetry object for the number of
    // fields you want, maximum of 29 1-bit fields possible.
    WsprMessageTelemetryExtendedVendorDefined<5> codec;

    /////////////////////////////////////////////////////////////////
    // Define telemetry fields
    /////////////////////////////////////////////////////////////////

    // Define tracker-specific telemetry, meant for the tracker
    // author to better understand the operation of the tracker
    // itself, rather than, say, a user deciding telemetry to see.
    codec.DefineField("UptimeMinutes",     0, 3600, 1);
    codec.DefineField("RebootsTodayCount", 0,  100, 1);


    /////////////////////////////////////////////////////////////////
    // Get encoded WSPR message fields (sourced elsewhere)
    /////////////////////////////////////////////////////////////////

    codec.SetCallsign("006AAH");
    codec.SetGrid4("KK13");
    codec.SetPowerDbm(30);


    /////////////////////////////////////////////////////////////////
    // Decode
    /////////////////////////////////////////////////////////////////

    codec.Decode();


    /////////////////////////////////////////////////////////////////
    // Extract the now-decoded WSPR message fields
    /////////////////////////////////////////////////////////////////

    int uptimeMinutes     = codec.Get("UptimeMinutes");
    int rebootsTodayCount = codec.Get("RebootsTodayCount");

    cout << "Encoded data"                             << endl;
    cout << "------------"                             << endl;
    cout << "uptimeMinutes    : " << uptimeMinutes     << endl; // 95
    cout << "rebootsTodayCount: " << rebootsTodayCount << endl; //  2

    return 0;
}

Output

Encoded data
------------
uptimeMinutes    : 95
rebootsTodayCount: 2