Skip to content

Commit

Permalink
Rebase and regen to fix ZAP/Android after project-chip#8680
Browse files Browse the repository at this point in the history
  • Loading branch information
kpschoedel committed Aug 4, 2021
1 parent 65857ef commit 2f2e1f4
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
3 changes: 1 addition & 2 deletions examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
3 changes: 1 addition & 2 deletions examples/window-app/common/gen/IMClusterCommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void DispatchServerCommand(app::CommandHandler * apCommandObj, CommandId aComman
ChipLogProgress(Zcl,
"Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT
", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32,
validArgumentCount, expectArgumentCount, ChipError::FormatError(TLVError),
ChipError::FormatError(TLVUnpackError), currentDecodeTagId);
validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId);
// A command with no arguments would never write currentDecodeTagId. If
// progress logging is also disabled, it would look unused. Silence that
// warning.
Expand Down
26 changes: 13 additions & 13 deletions src/controller/java/gen/CHIPClusters-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7925,14 +7925,14 @@ JNI_METHOD(void, AdministratorCommissioningCluster, openBasicCommissioningWindow
err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, ChipError::FormatError(err));
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format());
return;
}

err = CreateIllegalStateException(env, "Error invoking cluster", ChipError::FormatError(err), exception);
err = CreateIllegalStateException(env, "Error invoking cluster", err.Format(), exception);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, ChipError::FormatError(err));
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format());
return;
}
env->CallVoidMethod(callback, method, exception);
Expand Down Expand Up @@ -7977,14 +7977,14 @@ JNI_METHOD(void, AdministratorCommissioningCluster, openCommissioningWindow)
err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, ChipError::FormatError(err));
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format());
return;
}

err = CreateIllegalStateException(env, "Error invoking cluster", ChipError::FormatError(err), exception);
err = CreateIllegalStateException(env, "Error invoking cluster", err.Format(), exception);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, ChipError::FormatError(err));
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format());
return;
}
env->CallVoidMethod(callback, method, exception);
Expand Down Expand Up @@ -8023,14 +8023,14 @@ JNI_METHOD(void, AdministratorCommissioningCluster, revokeCommissioning)
err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, ChipError::FormatError(err));
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format());
return;
}

err = CreateIllegalStateException(env, "Error invoking cluster", ChipError::FormatError(err), exception);
err = CreateIllegalStateException(env, "Error invoking cluster", err.Format(), exception);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, ChipError::FormatError(err));
ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format());
return;
}
env->CallVoidMethod(callback, method, exception);
Expand All @@ -8044,15 +8044,15 @@ JNI_METHOD(void, AdministratorCommissioningCluster, readClusterRevisionAttribute
CHIPInt16uAttributeCallback * onSuccess = new CHIPInt16uAttributeCallback(callback);
if (!onSuccess)
{
ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY);
ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY.AsInteger());
return;
}

CHIPDefaultFailureCallback * onFailure = new CHIPDefaultFailureCallback(callback);
if (!onFailure)
{
delete onSuccess;
ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY);
ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY.AsInteger());
return;
}

Expand All @@ -8062,7 +8062,7 @@ JNI_METHOD(void, AdministratorCommissioningCluster, readClusterRevisionAttribute
{
delete onSuccess;
delete onFailure;
ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE);
ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE.AsInteger());
return;
}

Expand All @@ -8071,7 +8071,7 @@ JNI_METHOD(void, AdministratorCommissioningCluster, readClusterRevisionAttribute
{
delete onSuccess;
delete onFailure;
ReturnIllegalStateException(env, callback, "Error reading attribute", err);
ReturnIllegalStateException(env, callback, "Error reading attribute", err.AsInteger());
}
}
JNI_METHOD(jlong, ApplicationBasicCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId)
Expand Down
22 changes: 11 additions & 11 deletions src/controller/python/chip/clusters/CHIPClusters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,42 +377,42 @@ chip::ChipError::StorageType chip_ime_ReadAttribute_AccountLogin_ClusterRevision
chip::ChipError::StorageType chip_ime_AppendCommand_AdministratorCommissioning_OpenBasicCommissioningWindow(
chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId, uint16_t commissioningTimeout)
{
VerifyOrReturnError(device != nullptr, chip::ChipError::AsInteger(CHIP_ERROR_INVALID_ARGUMENT));
VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger());
chip::Controller::AdministratorCommissioningCluster cluster;
cluster.Associate(device, ZCLendpointId);
return chip::ChipError::AsInteger(cluster.OpenBasicCommissioningWindow(nullptr, nullptr, commissioningTimeout));
return cluster.OpenBasicCommissioningWindow(nullptr, nullptr, commissioningTimeout).AsInteger();
}
chip::ChipError::StorageType chip_ime_AppendCommand_AdministratorCommissioning_OpenCommissioningWindow(
chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId, uint16_t commissioningTimeout,
const uint8_t * pAKEVerifier, uint32_t pAKEVerifier_Len, uint16_t discriminator, uint32_t iterations, const uint8_t * salt,
uint32_t salt_Len, uint16_t passcodeID)
{
VerifyOrReturnError(device != nullptr, chip::ChipError::AsInteger(CHIP_ERROR_INVALID_ARGUMENT));
VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger());
chip::Controller::AdministratorCommissioningCluster cluster;
cluster.Associate(device, ZCLendpointId);
return chip::ChipError::AsInteger(cluster.OpenCommissioningWindow(nullptr, nullptr, commissioningTimeout,
chip::ByteSpan(pAKEVerifier, pAKEVerifier_Len), discriminator,
iterations, chip::ByteSpan(salt, salt_Len), passcodeID));
return cluster
.OpenCommissioningWindow(nullptr, nullptr, commissioningTimeout, chip::ByteSpan(pAKEVerifier, pAKEVerifier_Len),
discriminator, iterations, chip::ByteSpan(salt, salt_Len), passcodeID)
.AsInteger();
}
chip::ChipError::StorageType
chip_ime_AppendCommand_AdministratorCommissioning_RevokeCommissioning(chip::Controller::Device * device,
chip::EndpointId ZCLendpointId, chip::GroupId)
{
VerifyOrReturnError(device != nullptr, chip::ChipError::AsInteger(CHIP_ERROR_INVALID_ARGUMENT));
VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger());
chip::Controller::AdministratorCommissioningCluster cluster;
cluster.Associate(device, ZCLendpointId);
return chip::ChipError::AsInteger(cluster.RevokeCommissioning(nullptr, nullptr));
return cluster.RevokeCommissioning(nullptr, nullptr).AsInteger();
}

chip::ChipError::StorageType chip_ime_ReadAttribute_AdministratorCommissioning_ClusterRevision(chip::Controller::Device * device,
chip::EndpointId ZCLendpointId,
chip::GroupId /* ZCLgroupId */)
{
VerifyOrReturnError(device != nullptr, chip::ChipError::AsInteger(CHIP_ERROR_INVALID_ARGUMENT));
VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger());
chip::Controller::AdministratorCommissioningCluster cluster;
cluster.Associate(device, ZCLendpointId);
return chip::ChipError::AsInteger(
cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()));
return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger();
}

// End of Cluster AdministratorCommissioning
Expand Down

0 comments on commit 2f2e1f4

Please sign in to comment.