From c9749eb319cc6250097a32590fc4597969910718 Mon Sep 17 00:00:00 2001 From: Tony Cave Date: Thu, 10 Aug 2023 08:35:25 +0100 Subject: [PATCH 1/5] free handle on error --- .../linux/AirQualitySensorAppAttrUpdateDelegate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp b/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp index aea583d910bf12..7489a9ac9d7aaa 100644 --- a/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp +++ b/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp @@ -106,7 +106,10 @@ void AirQualitySensorAttrUpdateHandler::HandleCommand(intptr_t context) auto * self = reinterpret_cast(context); std::string clusterName = self->mJsonValue["Name"].asString(); - VerifyOrReturn(!self->mJsonValue.empty(), ChipLogError(NotSpecified, "Invalid JSON event command received")); + VerifyOrReturn(!self->mJsonValue.empty(), { + ChipLogError(NotSpecified, "Invalid JSON event command received"); + Platform::Delete(self); + }); if (clusterName == "AirQuality") { From b087d77cac218aa149df62b38af5d8e488eead66 Mon Sep 17 00:00:00 2001 From: Tony Cave Date: Thu, 10 Aug 2023 08:36:24 +0100 Subject: [PATCH 2/5] corrected README.md --- examples/air-quality-sensor-app/linux/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/air-quality-sensor-app/linux/README.md b/examples/air-quality-sensor-app/linux/README.md index a8710d62f0e3c5..a17f7def7f202f 100644 --- a/examples/air-quality-sensor-app/linux/README.md +++ b/examples/air-quality-sensor-app/linux/README.md @@ -116,14 +116,14 @@ To cross-compile this example on x64 host and run on **NXP i.MX 8M Mini** ## Trigger event using air-quality-sensor-app event named pipe You can send a command to air-quality-sensor-app to trigger specific event via -air-quality-sensor-app event named pipe /tmp/chip_air_quality_fifo-. +air-quality-sensor-app event named pipe /tmp/chip_air_quality_fifo_. ### Trigger air quality change event Generate event `AirQuality`, to change the air quality value. ``` -$ echo '{"Name":"AirQuality","NewValue":3}' > /tmp/chip_air_quality_fifo- +$ echo '{"Name":"AirQuality","NewValue":3}' > /tmp/chip_air_quality_fifo_ ``` ### Trigger Temperature change event @@ -131,7 +131,7 @@ $ echo '{"Name":"AirQuality","NewValue":3}' > /tmp/chip_air_quality_fifo- Generate event `TemperatureMeasurement`, to change the temperate value. ``` -$ echo '{"Name":"TemperatureMeasurement","NewValue":18}' > /tmp/chip_air_quality_fifo- +$ echo '{"Name":"TemperatureMeasurement","NewValue":18}' > /tmp/chip_air_quality_fifo_ ``` ### Trigger Humidity change event @@ -139,7 +139,7 @@ $ echo '{"Name":"TemperatureMeasurement","NewValue":18}' > /tmp/chip_air_quality Generate event `RelativeHumidityMeasurement`, to change the temperate value. ``` -$ echo '{"Name":"RelativeHumidityMeasurement","NewValue":60}' > /tmp/chip_air_quality_fifo- +$ echo '{"Name":"RelativeHumidityMeasurement","NewValue":60}' > /tmp/chip_air_quality_fifo_ ``` ### Trigger concentration change event @@ -150,5 +150,5 @@ clusters. Generate event `CarbonDioxideConcentrationMeasurement`, to change the CO2 value. ``` -$ echo '{"Name":"CarbonDioxideConcentrationMeasurement","NewValue":400}' > /tmp/chip_air_quality_fifo- +$ echo '{"Name":"CarbonDioxideConcentrationMeasurement","NewValue":400}' > /tmp/chip_air_quality_fifo_ ``` From 7d0a7a158ef2d370703386575e77ffa5b0a9c3a5 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 10 Aug 2023 07:39:37 +0000 Subject: [PATCH 3/5] Restyled by prettier-markdown --- examples/air-quality-sensor-app/linux/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/air-quality-sensor-app/linux/README.md b/examples/air-quality-sensor-app/linux/README.md index a17f7def7f202f..803c724c6225a9 100644 --- a/examples/air-quality-sensor-app/linux/README.md +++ b/examples/air-quality-sensor-app/linux/README.md @@ -116,7 +116,7 @@ To cross-compile this example on x64 host and run on **NXP i.MX 8M Mini** ## Trigger event using air-quality-sensor-app event named pipe You can send a command to air-quality-sensor-app to trigger specific event via -air-quality-sensor-app event named pipe /tmp/chip_air_quality_fifo_. +air-quality-sensor-app event named pipe /tmp/chip*air_quality_fifo*. ### Trigger air quality change event From 55c452105298b5b5449bca83b368198a8047b48a Mon Sep 17 00:00:00 2001 From: Tony Cave Date: Mon, 21 Aug 2023 09:29:59 +0100 Subject: [PATCH 4/5] updated readme --- examples/air-quality-sensor-app/linux/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/air-quality-sensor-app/linux/README.md b/examples/air-quality-sensor-app/linux/README.md index 803c724c6225a9..2ea34541c2f9e6 100644 --- a/examples/air-quality-sensor-app/linux/README.md +++ b/examples/air-quality-sensor-app/linux/README.md @@ -116,7 +116,7 @@ To cross-compile this example on x64 host and run on **NXP i.MX 8M Mini** ## Trigger event using air-quality-sensor-app event named pipe You can send a command to air-quality-sensor-app to trigger specific event via -air-quality-sensor-app event named pipe /tmp/chip*air_quality_fifo*. +air-quality-sensor-app event named pipe /tmp/chip_air_quality_fifo*. ### Trigger air quality change event From 8f679455e5c4b8a5157120a6d8cca8c8c1958253 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 21 Aug 2023 08:30:28 +0000 Subject: [PATCH 5/5] Restyled by prettier-markdown --- examples/air-quality-sensor-app/linux/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/air-quality-sensor-app/linux/README.md b/examples/air-quality-sensor-app/linux/README.md index 2ea34541c2f9e6..51798c23ef441f 100644 --- a/examples/air-quality-sensor-app/linux/README.md +++ b/examples/air-quality-sensor-app/linux/README.md @@ -116,7 +116,7 @@ To cross-compile this example on x64 host and run on **NXP i.MX 8M Mini** ## Trigger event using air-quality-sensor-app event named pipe You can send a command to air-quality-sensor-app to trigger specific event via -air-quality-sensor-app event named pipe /tmp/chip_air_quality_fifo*. +air-quality-sensor-app event named pipe /tmp/chip_air_quality_fifo\*. ### Trigger air quality change event