[][src]Module app::app_sensor

Poll the temperature sensor every 10 seconds. Transmit the sensor data to the CoAP server after polling. This is the Rust version of https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nrf52/apps/my_sensor_app/OLDsrc/sensor.c

Constants

SENSOR_POLL_TIME

Poll sensor every 30,000 milliseconds (30 seconds)

TEMP_SENSOR_KEY

Use key (field name) t to transmit raw temperature to CoAP Server

TEMP_SENSOR_TYPE

Type of sensor: Raw temperature sensor (integer sensor values 0 to 4095)

Statics

SENSOR_DEVICE

Sensor to be polled: temp_stub_0 is the stub temperature sensor that simulates a temperature sensor

Functions

start_sensor_listener

Ask Mynewt to poll or read the temperature sensor and call aggregate_sensor_data() Return Ok() if successful, else return Err() with MynewtError error code inside.