I am studying the Rapid IoT Weather Station demo provided in the Online IDE (Studio) and I am not getting the magic behind retrieving values from ENS210 temperature and humidity sensor. The sensor is triggered by interval and gets two "tasks":
Once the humidity is measured it sets the value of Humidity Characteristics (sends the humidity number over BLE):
But it uses the same trigger (Humidity Read) to connect to Temperature Characteristics. How does it pass the temperature number to it? Especially when there is no Set Value event?
Analogically here:
I would expect to have something like this in the "temperature stream":
Nevertheless if I update the flow according to the picture above it immediatelly affects the "humidity stream":
What am I missing?
Hi,
What am I missing?
No, you are right, you are not missing anything.
But it uses the same trigger (Humidity Read) to connect to Temperature Characteristics. How does it pass the temperature number to it? Especially when there is no Set Value event?
The sensor is using the same trigger as you mentioned, and also the same set value event,
If you look into the code, the trigger is for the temp and the humidity.
case ATMO_ABILITY(ENS210TemperatureHumidity, trigger):
{
ATMO_Value_t ENS210TemperatureHumidity_Value;
ATMO_InitValue(&ENS210TemperatureHumidity_Value);
ENS210TemperatureHumidity_trigger(value, &ENS210TemperatureHumidity_Value);
ATMO_TriggerHandler(ATMO_TRIGGER(ENS210TemperatureHumidity, triggered), &ENS210TemperatureHumidity_Value);
ATMO_FreeValue(&ENS210TemperatureHumidity_Value);
break;
}
Regards,
Mario