Skip to content

Commit

Permalink
#if ICD_SERVER the icd related event posts
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinez-silabs committed Jul 4, 2023
1 parent 7edbd32 commit fc1976b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/app/server/CommissioningWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ void CommissioningWindowManager::UpdateWindowStatus(CommissioningWindowStatusEnu
if (mWindowStatus != aNewStatus)
{
mWindowStatus = aNewStatus;

#if CHIP_CONFIG_ENABLE_ICD_SERVER
DeviceLayer::ChipDeviceEvent event;
event.Type = DeviceLayer::DeviceEventType::kCommissioningWindowStatusChanged;
event.CommissioningWindowStatus.open = (mWindowStatus != CommissioningWindowStatusEnum::kWindowNotOpen);
Expand All @@ -576,6 +576,7 @@ void CommissioningWindowManager::UpdateWindowStatus(CommissioningWindowStatusEnu
{
ChipLogError(AppServer, "Failed to post kCommissioningWindowStatusChanged event %" CHIP_ERROR_FORMAT, err.Format());
}
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
}

if (CommissioningWindowStatusForCluster() != oldClusterStatus)
Expand Down
14 changes: 7 additions & 7 deletions src/messaging/ExchangeContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgTyp

if (err == CHIP_NO_ERROR)
{
#if CONFIG_DEVICE_LAYER
#if CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER
DeviceLayer::ChipDeviceEvent event;
event.Type = DeviceLayer::DeviceEventType::kChipMsgSentEvent;
event.MessageSent.ExpectResponse = IsResponseExpected();
Expand Down Expand Up @@ -300,7 +300,7 @@ void ExchangeContext::DoClose(bool clearRetransTable)
{
// Cancel the response timer.
CancelResponseTimer();
#if CONFIG_DEVICE_LAYER
#if CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER
DeviceLayer::ChipDeviceEvent event;
event.Type = DeviceLayer::DeviceEventType::kChipMsgRxEventHandled;
event.RxEventContext.wasReceived = false;
Expand All @@ -311,7 +311,7 @@ void ExchangeContext::DoClose(bool clearRetransTable)
ChipLogError(DeviceLayer, "Failed to post Msg Handled event at ExchangeContext closure %" CHIP_ERROR_FORMAT,
status.Format());
}
#endif // CONFIG_DEVICE_LAYER
#endif // CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER
}
}

Expand Down Expand Up @@ -522,7 +522,7 @@ void ExchangeContext::HandleResponseTimeout(System::Layer * aSystemLayer, void *

void ExchangeContext::NotifyResponseTimeout(bool aCloseIfNeeded)
{
#if CONFIG_DEVICE_LAYER
#if CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER
DeviceLayer::ChipDeviceEvent event;
event.Type = DeviceLayer::DeviceEventType::kChipMsgRxEventHandled;
event.RxEventContext.wasReceived = false;
Expand All @@ -532,7 +532,7 @@ void ExchangeContext::NotifyResponseTimeout(bool aCloseIfNeeded)
{
ChipLogError(DeviceLayer, "Failed to post Message Response Timeout event %" CHIP_ERROR_FORMAT, status.Format());
}
#endif // CONFIG_DEVICE_LAYER
#endif // CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER

SetResponseExpected(false);

Expand Down Expand Up @@ -646,7 +646,7 @@ CHIP_ERROR ExchangeContext::HandleMessage(uint32_t messageCounter, const Payload
return CHIP_ERROR_INCORRECT_STATE;
}

#if CONFIG_DEVICE_LAYER
#if CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER
DeviceLayer::ChipDeviceEvent event;
event.Type = DeviceLayer::DeviceEventType::kChipMsgRxEventHandled;
event.RxEventContext.wasReceived = true;
Expand All @@ -656,7 +656,7 @@ CHIP_ERROR ExchangeContext::HandleMessage(uint32_t messageCounter, const Payload
{
ChipLogError(DeviceLayer, "Failed to post Message received event %" CHIP_ERROR_FORMAT, status.Format());
}
#endif // CONFIG_DEVICE_LAYER
#endif // CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER

if (IsResponseExpected())
{
Expand Down

0 comments on commit fc1976b

Please sign in to comment.