void valent_packet_init ( JsonBuilder** builder, const char* type )
JsonBuilder and KDE Connect packet.
Creates a new
JsonBuilder and initializes a packet for
leaving the builder in the
body object. Call
to finish the packet and get the result.
g_autoptr (JsonBuilder) builder = NULL; g_autoptr (JsonNode) packet = NULL; valent_packet_init (&builder, "kdeconnect.ping"); json_builder_set_member_name (builder, "message"); json_builder_add_string_value (builder, "Ping!"); packet = valent_packet_end (&builder);
Available since: 1.0
This function is not directly available to language bindings.
A location to initialize a
The data is owned by the caller of the function.
A KDE Connect packet type.
The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string.