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 cecille committed Sep 3, 2024
1 parent 910d5ed commit e3d9480
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/controller/python/ChipDeviceController-Discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ bool pychip_DeviceController_GetIPForDiscoveredDevice(Controller::DeviceCommissi
return false;
}

PyChipError pychip_CreateManualCode(uint16_t longDiscriminator, uint32_t passcode, char * manualCodeBuffer, size_t inBufSize, size_t* outBufSize)
PyChipError pychip_CreateManualCode(uint16_t longDiscriminator, uint32_t passcode, char * manualCodeBuffer, size_t inBufSize,
size_t * outBufSize)
{
SetupPayload payload;
SetupDiscriminator discriminator;
Expand All @@ -200,14 +201,16 @@ PyChipError pychip_CreateManualCode(uint16_t longDiscriminator, uint32_t passcod
payload.setUpPINCode = passcode;
std::string setupManualCode;

*outBufSize = 0;
*outBufSize = 0;
CHIP_ERROR err = ManualSetupPayloadGenerator(payload).payloadDecimalStringRepresentation(setupManualCode);
if (err == CHIP_NO_ERROR) {
if (err == CHIP_NO_ERROR)
{
MutableCharSpan span(manualCodeBuffer, inBufSize);
// Plus 1 so we copy the null terminator
CopyCharSpanToMutableCharSpan(CharSpan(setupManualCode.c_str(), setupManualCode.length()+1), span);
CopyCharSpanToMutableCharSpan(CharSpan(setupManualCode.c_str(), setupManualCode.length() + 1), span);
*outBufSize = span.size();
if (*outBufSize == 0) {
if (*outBufSize == 0)
{
err == CHIP_ERROR_NO_MEMORY;
}
}
Expand Down

0 comments on commit e3d9480

Please sign in to comment.