AiCPlayer
Interface of aic vm - for rendering aspect, sensors, video records
Functions
protobuf_framing.h File Reference

Utility to convert framing to varint32 for google’s parser. More...

#include <stdint.h>
#include <amqp.h>
#include "socket.h"
Include dependency graph for protobuf_framing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint32_t convert_framing_size (uint32_t len, uint8_t *bytes)
 Convert an unsigned int to varint32 so that google’s C++ protobuf libs can read it. More...
 
int write_protobuf (socket_t sock, amqp_envelope_t *envelope)
 Write a protobuf, with a varint32 framing, and padding at the end from an envelope. More...
 

Detailed Description

Utility to convert framing to varint32 for google’s parser.

Definition in file protobuf_framing.h.

Function Documentation

uint32_t convert_framing_size ( uint32_t  len,
uint8_t *  bytes 
)

Convert an unsigned int to varint32 so that google’s C++ protobuf libs can read it.

Parameters
lenthe length to convert to varint32
bytesa preallocated buffer to store the varint
Returns
the number of bytes written in the buffer

bytes must be preallocated with at list 4 elements.

Convert unsigned int to varint32

Definition at line 13 of file protobuf_framing.c.

Here is the caller graph for this function:

int write_protobuf ( socket_t  sock,
amqp_envelope_t *  envelope 
)

Write a protobuf, with a varint32 framing, and padding at the end from an envelope.

Parameters
sockthe socket to use
envelopethe envelope containing the bytes to write on the socket

Write a protobuf, with a varint32 framing, and padding at the end

Definition at line 31 of file protobuf_framing.c.

Here is the call graph for this function:

Here is the caller graph for this function: