Closed brentru closed 2 years ago
Adding max_count nanopb compiler flag to the SensorEvent to assist with encoding.
max_count
SensorEvent
Moves away from a callback encoding model (we did not get this working last time) to compiling the senor_event as an array of sensor_event structs.
Example C++ code:
// Pack SensorEvent payload msgi2cResponse.payload.resp_i2c_device_event.sensor_event[msgi2cResponse.payload.resp_i2c_device_event.sensor_event_count].type = wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE; msgi2cResponse.payload.resp_i2c_device_event.sensor_event[msgi2cResponse.payload.resp_i2c_device_event.sensor_event_count].value = temp; // Increment counter msgi2cResponse.payload.resp_i2c_device_event.sensor_event_count++;
Adding
max_count
nanopb compiler flag to theSensorEvent
to assist with encoding.Moves away from a callback encoding model (we did not get this working last time) to compiling the senor_event as an array of sensor_event structs.
Example C++ code: