Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/air quality sensor app leak #28619

Merged
merged 6 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ void AirQualitySensorAttrUpdateHandler::HandleCommand(intptr_t context)
auto * self = reinterpret_cast<AirQualitySensorAttrUpdateHandler *>(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")
{
Expand Down
10 changes: 5 additions & 5 deletions examples/air-quality-sensor-app/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,30 @@ 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-<PID>.
air-quality-sensor-app event named pipe /tmp/chip_air_quality_fifo\*<PID>.

### Trigger air quality change event

Generate event `AirQuality`, to change the air quality value.

```
$ echo '{"Name":"AirQuality","NewValue":3}' > /tmp/chip_air_quality_fifo-<PID>
$ echo '{"Name":"AirQuality","NewValue":3}' > /tmp/chip_air_quality_fifo_<PID>
```

### Trigger Temperature change event

Generate event `TemperatureMeasurement`, to change the temperate value.

```
$ echo '{"Name":"TemperatureMeasurement","NewValue":18}' > /tmp/chip_air_quality_fifo-<PID>
$ echo '{"Name":"TemperatureMeasurement","NewValue":18}' > /tmp/chip_air_quality_fifo_<PID>
```

### Trigger Humidity change event

Generate event `RelativeHumidityMeasurement`, to change the temperate value.

```
$ echo '{"Name":"RelativeHumidityMeasurement","NewValue":60}' > /tmp/chip_air_quality_fifo-<PID>
$ echo '{"Name":"RelativeHumidityMeasurement","NewValue":60}' > /tmp/chip_air_quality_fifo_<PID>
```

### Trigger concentration change event
Expand All @@ -150,5 +150,5 @@ clusters.
Generate event `CarbonDioxideConcentrationMeasurement`, to change the CO2 value.

```
$ echo '{"Name":"CarbonDioxideConcentrationMeasurement","NewValue":400}' > /tmp/chip_air_quality_fifo-<PID>
$ echo '{"Name":"CarbonDioxideConcentrationMeasurement","NewValue":400}' > /tmp/chip_air_quality_fifo_<PID>
```