air-quality-wing-zephyr-demo
air-quality-wing-zephyr-demo
1
Project description
This source code is part of an application that works with the Zephyr RTOS, a program that collects and processes data from air quality sensors. The main parts and functions of the source code are as follows.
Include header: Contains various libraries and modules related to Zephyr, especially using sensor data coding and network related libraries.
Sensor data definition: Declare a struct array named sensor_data to store multiple sensor data items.
Handling date and time events: The date_time_evt function starts the Golioth system client when the system receives the current time.
Publish Data: The publish function encodes the sensor data and sends the data to Golioth LightDB in CBOR format.
Main function:
- Reset: Initializes the network and Bluetooth Center.
- Event Loop: The application continuously checks for events, adding sensor data to the array whenever it receives Bluetooth data.
- Publish data: When enough sensor data is accumulated, call
publishfunction to publish data. - handle ethernet ready event: Do a time update when ethernet is ready.
This code is responsible for centrally processing and remotely transmitting the data collected by air quality sensors, so it could be used in IoT devices or air quality monitoring systems.
