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") { diff --git a/examples/air-quality-sensor-app/linux/README.md b/examples/air-quality-sensor-app/linux/README.md index a8710d62f0e3c5..51798c23ef441f 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_ ```