Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and liangpy4 committed Nov 24, 2023
1 parent 471a0b0 commit 2c1b743
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/microwave-oven-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void ApplicationInit()
gMicrowaveOvenDevice.get()->Init(kMicrowwaveOvenEndpointId);
}

void ApplicationShutdown(){}
void ApplicationShutdown() {}

int main(int argc, char * argv[])
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ class ExampleMicrowaveOvenControlDelegate : public MicrowaveOvenControl::Delegat
/**
* define callback binding function
*/
std::unique_ptr<std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)>> mHandleSetCookingParametersCallback;
std::unique_ptr<std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)>>
mHandleSetCookingParametersCallback;
std::unique_ptr<std::function<Protocols::InteractionModel::Status(uint32_t)>> mHandleAddMoreTimeCallback;

public:
/**
* Handle Command Callback in application: set-cooking-parameters
*/
Protocols::InteractionModel::Status HandleSetCookingParametersCommandCallback(uint8_t cookMode, uint32_t cookTime,
uint8_t powerSetting) override;
uint8_t powerSetting) override;

/**
* Handle Command Callback in application: add-more-time
Expand Down Expand Up @@ -78,8 +79,6 @@ class ExampleMicrowaveOvenControlDelegate : public MicrowaveOvenControl::Delegat
* Set callback function for add more time
*/
void SetMicrowaveOvenControlAddMoreTimeCallback(std::function<Protocols::InteractionModel::Status(uint32_t)> aCallback);


};

} // namespace MicrowaveOvenControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MicrowaveOvenDevice
* handle command for microwave oven control: set cooking parameters
*/
Protocols::InteractionModel::Status HandleMicrowaveOvenSetCookingParametersCommandCallback(uint8_t cookMode, uint32_t cookTime,
uint8_t powerSetting);
uint8_t powerSetting);

/**
* handle command for microwave oven control: add more time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ using namespace chip::app::Clusters::MicrowaveOvenControl;

// Microwave Oven Control command callbacks
Protocols::InteractionModel::Status
ExampleMicrowaveOvenControlDelegate::HandleSetCookingParametersCommandCallback(uint8_t cookMode, uint32_t cookTime, uint8_t powerSetting)
ExampleMicrowaveOvenControlDelegate::HandleSetCookingParametersCommandCallback(uint8_t cookMode, uint32_t cookTime,
uint8_t powerSetting)
{
return (*mHandleSetCookingParametersCallback.get())(cookMode, cookTime, powerSetting);
}
Expand All @@ -37,7 +38,8 @@ Protocols::InteractionModel::Status ExampleMicrowaveOvenControlDelegate::HandleA
void ExampleMicrowaveOvenControlDelegate::SetMicrowaveOvenControlSetCookingParametersCallback(
std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)> aCallback)
{
mHandleSetCookingParametersCallback = std::make_unique<std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)>>(aCallback);
mHandleSetCookingParametersCallback =
std::make_unique<std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)>>(aCallback);
}

void ExampleMicrowaveOvenControlDelegate::SetMicrowaveOvenControlAddMoreTimeCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ using OperationalStateEnum = chip::app::Clusters::OperationalState::OperationalS
using Status = Protocols::InteractionModel::Status;

Protocols::InteractionModel::Status
MicrowaveOvenDevice::HandleMicrowaveOvenSetCookingParametersCommandCallback(uint8_t cookMode, uint32_t cookTime, uint8_t powerSetting)
MicrowaveOvenDevice::HandleMicrowaveOvenSetCookingParametersCommandCallback(uint8_t cookMode, uint32_t cookTime,
uint8_t powerSetting)
{
// placeholder implementation
// TODO(#30609): set Microwave Oven cooking mode by cookMode.Value().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class Delegate
* @return Returns the Interaction Model status code which was user determined in the business logic
*/
virtual Protocols::InteractionModel::Status HandleSetCookingParametersCommandCallback(uint8_t cookMode, uint32_t cookTime,
uint8_t powerSetting) = 0;
uint8_t powerSetting) = 0;

/**
* @brief Handle Command Callback in application: AddMoreTime
Expand Down

0 comments on commit 2c1b743

Please sign in to comment.