From 8b87c1290affbe9a746ce207598fc9388a9b07a1 Mon Sep 17 00:00:00 2001 From: James Westman Date: Wed, 15 Jul 2020 22:00:56 -0500 Subject: [PATCH] packet: Fix capabilities Capabilities should be serialized in "incomingCapabilities" and "outgoingCapabilities" string arrays within the packet body. --- src/mconnect/packet.vala | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/mconnect/packet.vala b/src/mconnect/packet.vala index 0e1ccdd..51b0cf2 100644 --- a/src/mconnect/packet.vala +++ b/src/mconnect/packet.vala @@ -142,10 +142,18 @@ class Packet : GLib.Object { builder.add_string_value (device_id); builder.set_member_name ("deviceType"); builder.add_string_value (device_type); - builder.set_member_name ("SupportedIncomingInterfaces"); - builder.add_string_value (string.joinv (",", in_interfaces)); - builder.set_member_name ("SupportedOutgoingInterfaces"); - builder.add_string_value (string.joinv (",", out_interfaces)); + builder.set_member_name ("incomingCapabilities"); + builder.begin_array (); + foreach (string iface in in_interfaces) { + builder.add_string_value (iface); + } + builder.end_array (); + builder.set_member_name ("outgoingCapabilities"); + builder.begin_array (); + foreach (string iface in out_interfaces) { + builder.add_string_value (iface); + } + builder.end_array (); builder.set_member_name ("protocolVersion"); builder.add_int_value (PROTOCOL_VERSION); builder.end_object (); @@ -178,4 +186,4 @@ class Packet : GLib.Object { return data; } -} \ No newline at end of file +}