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 j-ororke committed Dec 8, 2024
1 parent 427834d commit 0ca175b
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/controller/python/OpCredsBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,26 +720,25 @@ PyChipError pychip_GetCompletionError()
return ToPyChipError(sTestCommissioner.GetCompletionError());
}


extern "C" {
// Function to get the RCAC data from the sTestCommissioner
void pychip_GetCommissioningRCACData(uint8_t * rcacDataPtr, size_t * rcacSize)
{
// Attempting to get Python RCAC data in C++
const auto & rcacData = sTestCommissioner.GetCHIPRCACData();
// Function to get the RCAC data from the sTestCommissioner
void pychip_GetCommissioningRCACData(uint8_t * rcacDataPtr, size_t * rcacSize)
{
// Attempting to get Python RCAC data in C++
const auto & rcacData = sTestCommissioner.GetCHIPRCACData();

if (rcacData.empty())
{
ChipLogError(Controller, "RCAC data is empty in C++. Nothing to return.");
*rcacSize = 0;
return;
}
if (rcacData.empty())
{
ChipLogError(Controller, "RCAC data is empty in C++. Nothing to return.");
*rcacSize = 0;
return;
}

// Ensure the size is passed back to Python
*rcacSize = rcacData.size();
// Ensure the size is passed back to Python
*rcacSize = rcacData.size();

// Copy the data from C++ to Python's allocated memory
std::memcpy(rcacDataPtr, rcacData.data(), *rcacSize);
}
// Copy the data from C++ to Python's allocated memory
std::memcpy(rcacDataPtr, rcacData.data(), *rcacSize);
}
}
} // extern "C"

0 comments on commit 0ca175b

Please sign in to comment.