gre_io_serialized_data_t* gre_io_serialize(
gre_io_serialized_data_t * buffer,
const char * event_target,
const char * event_name,
const char * event_format,
const void * event_data,
int event_nbytes
)
Serialize individual event items (see gre/io_mgr.h) into a
single buffer for transmission using Storyboard IO.
Parameters:
buffer The buffer that will contain the serialized data or NULL if a new buffer should be allocated
event_target The name of the event target model element (screen,layer, control, render extension),
or NULL to send to the default target (application level)
event_name The name of the event to send, or NULL to send an empty event
event_format The format description of the data (ex. "1s0 string") or NULL if no data is being sent
event_data A pointer do the data to transmit, or NULL if no data is transmitted
event_nbytes The number of data bytes to transmit, or NULL if no data is transmitted
Returns:
A buffer with the serialized data or NULL on error. It may be necessary for the
internal buffer to be re-sized or re-allocated if the new data payload is larger than the
previous one is being serialized.
Example:
nbuffer = gre_io_serialize(nbuffer, NULL, "cluster_update",
"2u1 speed 2u1 rpm 2u1 fuel 2u1 battery 2u1 oil 2u1 odometer 2u1 trip",
&event_data, sizeof(event_data));
if(!nbuffer) {
fprintf(stderr, "Can't serialized data to buffer, exiting\n");
break;
}