[−][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/rust-nbiot/apps/my_sensor_app/OLDsrc/sensor.c
Constants
| SENSOR_POLL_TIME | Poll sensor every 10,000 milliseconds (10 seconds) |
| TEMP_SENSOR_KEY | Use key (field name) |
| TEMP_SENSOR_TYPE | Type of sensor: Raw temperature sensor (integer sensor values 0 to 4095) |
Statics
| SENSOR_DEVICE | Sensor to be polled: |
Functions
| convert_sensor_data | Convert the raw temperature value received from Mynewt into a |
| handle_sensor_data | This listener function is called every 10 seconds by Mynewt to handle the polled sensor data. Return 0 if we have handled the sensor data successfully. |
| start_sensor_listener | Ask Mynewt to poll the temperature sensor every 10 seconds and call |