New discovery protocol

  • 2
  • Announcement
  • Updated 5 years ago
  • (Edited)
For all versions after v1.1.3, there will be a new discovery protocol for the radio.  The new protocol uses VITA-49 instead of the FlexRadio proprietary format for encapsulation and is sent to the standard VITA-49 port along with all other streaming data (4991).  to port 4992 just like the older protocol.  The old protocol was designed for one of our first Ethernet based radios, the CDRX-3200, and so we decided to use the same protocol for SmartSDR.  The primary issues with the protocol is that it is not name/value pair encoded, it is really field encoded so it makes it difficult to add new fields without causing an issue.  

In the new format, it is sent as a VITA-49 extension packet with stream ID 0x800 and a class ID of 0x534CFFFF.  The only payload present in the protocol is a string that looks like a status string we emit now so that you can share a parsing mechanism.  The string formatter (C) is currently:
model=%s serial=%s version=%s name=%s callsign=%s ip=%u.%u.%u.%u port=%u
The only deviation from what we've done before is that any spaces in the name field are converted to underscores (_) for this packet so you should convert underscores to spaces for any kind of display.  The preamble of the packet is just a standard VITA-49 format.  Here is the C struct:

typedef struct _vita_ext_data_discovery
{
uint32 header;
uint32 stream_id;
uint32 class_id_h;
uint32 class_id_l;
uint32 timestamp_int;
uint32 timestamp_frac_h;
uint32 timestamp_frac_l;
char payload[MAX_DISCOVERY_PAYLOAD_SIZE];
} vita_ext_data_discovery, *VitaExtDataDiscovery;
And the population is as such (consult the VITA-49 standard):

discovery_packet.header = htonl(
VITA_PACKET_TYPE_EXT_DATA_WITH_STREAM_ID |
VITA_HEADER_CLASS_ID_PRESENT |
VITA_TSI_OTHER |
VITA_TSF_SAMPLE_COUNT |
((packet_count++ & 0xF) << 16) |
(packet_len_words & 0xFFFF));
discovery_packet.stream_id = htonl(stream_id);
discovery_packet.class_id_h =  htonl(class_id_h);
discovery_packet.class_id_l =  htonl(class_id_l);
discovery_packet.timestamp_int = 0;
discovery_packet.timestamp_frac_h = 0;
discovery_packet.timestamp_frac_l = 0;
// the copy ensures that we are on a 4-byte boundary per VITA-49 rules
memcpy(discovery_packet.payload, discovery_string, payload_len_bytes + 4);  // copy extra 4 bytes of zeroes to be sure we get to 32-bits




Through the next release of SmartSDR (v1.2), we will be emitting both packets at the same time.  You will be required to adopt this protocol in order for your application to work with SmartSDR v1.3 and later.

If you are not using the SmartSDR API, but are using FlexLib, then this is all taken care of for you and you do not need to do anything other than update FlexLib and ensure it works with your application.  FlexLib now uses only the new protocol.

Steve
Photo of Steve - N5AC

Steve - N5AC, VP Engineering / CTO

  • 1030 Posts
  • 999 Reply Likes

Posted 5 years ago

  • 2
Photo of Steve - K5FR

Steve - K5FR

  • 65 Posts
  • 9 Reply Likes
I did an update from the GIT and am now receiving the following errors when I compile. Looks like I may need an additional reference(s).

Error 1 Source file 'C:\Users\Dev\Documents\GitHub\smartsdr-win\Vita\VitaFlex.cs' could not be opened ('Unspecified error ')

Error 2 The type or namespace name 'VitaDiscoveryPacket' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Dev\Documents\GitHub\smartsdr-win\FlexLib\API.cs 143 56

Error 3 The name 'VitaFlex' does not exist in the current context C:\Users\Dev\Documents\GitHub\smartsdr-win\FlexLib\API.cs 122 30

Photo of Richard Clafton W4/G7EIX

Richard Clafton W4/G7EIX, Elmer

  • 455 Posts
  • 117 Reply Likes
Where can I get the new FlexLib codebase?  Is there a GIT to download from?  I only have the original release that was issued by email.
(Edited)
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 676 Posts
  • 204 Reply Likes
There is not a public repo at this point.  We have been sending out zipped snapshots to those that are in the ADP that are interested in FlexLib.
Photo of Richard Clafton W4/G7EIX

Richard Clafton W4/G7EIX, Elmer

  • 455 Posts
  • 117 Reply Likes

Ok.  Understood.  Could you add me to the list for the updated version when ready please.  Thanks!
Photo of Stu Phillips - K6TU

Stu Phillips - K6TU, Elmer

  • 642 Posts
  • 256 Reply Likes
Steve,

Your comment above about:

The only deviation from what we've done before is that any spaces in the name field are converted to underscores (_) for this packet so you should convert underscores to spaces for any kind of display.

Does this mean that the Name and Callsign fields should be guaranteed NOT to include (_)?

I'm thinking about contest stations that might have multiple radios and use either a name or callsign with one embedded.

The currently isn't a spec for either field that defines what may (or not) be in it...

Very much appreciate the heads up - I'll make sure that both methods are supported and also that the VITA support I add for Objective C doesn't automagically drag in pan or stream support unless desired.

Stu K6TU

Photo of Steve - N5AC

Steve - N5AC, VP Engineering / CTO

  • 1030 Posts
  • 999 Reply Likes
You may send the radio an underscore, but it will probably be displayed in the radio as a space.