/* Serializes a sensor_t object as a byte array.  */
size_t sensorsSerializeSensor(uint8_t *buffer, const sensor_t *sensor)
/* Serializes a sensor_t object as a byte array.  */
size_t sensorsSerializeSensor(uint8_t *buffer, const sensor_t *sensor)
{
   size_t i = 0;
   memcpy(&buffer[i], &sensor->name, sizeof sensor->name);
   i += sizeof sensor->name;
   memcpy(&buffer[i], &sensor->version, sizeof sensor->version);
   i += sizeof sensor->version;
   memcpy(&buffer[i], &sensor->sensor_id, sizeof sensor->sensor_id);
   i += sizeof sensor->sensor_id;
   memcpy(&buffer[i], &sensor->type, sizeof sensor->type);
   i += sizeof sensor->type;
   memcpy(&buffer[i], &sensor->max_value, sizeof sensor->max_value);
   i += sizeof sensor->max_value;
   memcpy(&buffer[i], &sensor->min_value, sizeof sensor->min_value);
   i += sizeof sensor->min_value;
   memcpy(&buffer[i], &sensor->resolution, sizeof sensor->resolution);
   i += sizeof sensor->resolution;
   memcpy(&buffer[i], &sensor->min_delay, sizeof sensor->min_delay);
   i += sizeof sensor->min_delay;
   return i;
}