Function

Valentpacket_serialize

unstable since: 1.0

Declaration [src]

char*
valent_packet_serialize (
  JsonNode* packet,
  size_t* length
)

Description [src]

Convenience function that updates the timestamp of a packet before returning a serialized string with newline ending, ready to be written to a stream.

Available since: 1.0

Parameters

packet

Type: JsonNode

A complete KDE Connect packet.

The data is owned by the caller of the function.
length

Type: size_t*

A location for the length.

The argument will be set by the function.
The argument can be set to NULL by the function.

Return value

Type: char*

The serialized packet.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The return value can be NULL.
The value is a NUL terminated UTF-8 string.