UDP broadcasts are different to what is stated in documentation

Hey everyone.

I was tinkering around with the Connect API via ifc2 when I noticed it wasn’t connecting to my device properly. I looked into the source code and it appeared fine, so I did some digging through wireshark and found out what was actually being broadcasted.

For reference, this is what the documentation has an example:

    ["State": Playing, "Port": 10111, "DeviceID": iPad7, "Aircraft": Cessna 172,
    "Version": 19.4.7354.25209, "DeviceName": Thomas’s iPad,
    "Addresses":("fe80::1c79:baf4:f9f1:dd59%3", "192.168.1.26"),
    "Livery": Civil Air Patrol]

This is what I found:

{"addresses":["192.168.1.64"],"port":10112,"deviceID":"motorola moto g(8) power lite","version":"23.3.3.6193","deviceName":"moto g(8) power lite","state":"Playing","aircraft":"DC-10F","livery":"Fedex"}

It looks like a JSON object kinda thing is being broadcasted, and the keys are no longer capitalized.

Can someone please confirm and clarify? Cheers.

Hey, sorry about this. It looks like the formatting in the documentation is incorrect (it has always been a JSON object). What you received is the format you should expect to receive.

The contents are in JSON, and the key names now use camel case (the casing is due to a change we made to our JSON serializer a few updates ago).

We’ll make sure to get that updated, thanks for letting us know :)

1 Like

For reference, this is the C# representation of what we send:

public class APIServerInfo
{
    [JsonPropertyName("addresses")]
    public string[] Addresses { get; set; }

    [JsonPropertyName("port")]
    public int Port { get; set; }

    [JsonPropertyName("deviceId")]
    public string DeviceID { get; set; }

    [JsonPropertyName("version")]
    public string Version { get; set; }

    [JsonPropertyName("deviceName")]
    public string DeviceName { get; set; }

    [JsonPropertyName("state")]
    public string State { get; set; }

    [JsonPropertyName("aircraft")]
    public string Aircraft { get; set; }

    [JsonPropertyName("livery")]
    public string Livery { get; set; }
}
2 Likes

Ah, I see. Thank you so much!