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 joonhaengHeo committed Apr 26, 2024
1 parent a5ba9fe commit 06453c7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
17 changes: 11 additions & 6 deletions src/controller/java/AndroidICDClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

chip::app::DefaultICDClientStorage sICDClientStorage;

jobject getICDClientInfo(JNIEnv *env, const char * icdClientInfoSign, jint jFabricIndex)
jobject getICDClientInfo(JNIEnv * env, const char * icdClientInfoSign, jint jFabricIndex)
{
CHIP_ERROR err = CHIP_NO_ERROR;

Expand Down Expand Up @@ -69,13 +69,15 @@ jobject getICDClientInfo(JNIEnv *env, const char * icdClientInfoSign, jint jFabr
continue;
}

err = chip::JniReferences::GetInstance().N2J_ByteArray(env, info.aes_key_handle.As<chip::Crypto::Symmetric128BitsKeyByteArray>(),
err = chip::JniReferences::GetInstance().N2J_ByteArray(env,
info.aes_key_handle.As<chip::Crypto::Symmetric128BitsKeyByteArray>(),
chip::Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES, jIcdAesKey);
VerifyOrReturnValue(err == CHIP_NO_ERROR, nullptr,
ChipLogError(Controller, "ICD AES KEY N2J_ByteArray error!: %" CHIP_ERROR_FORMAT, err.Format()));

err = chip::JniReferences::GetInstance().N2J_ByteArray(env, info.hmac_key_handle.As<chip::Crypto::Symmetric128BitsKeyByteArray>(),
chip::Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES, jIcdHmacKey);
err = chip::JniReferences::GetInstance().N2J_ByteArray(
env, info.hmac_key_handle.As<chip::Crypto::Symmetric128BitsKeyByteArray>(),
chip::Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES, jIcdHmacKey);
VerifyOrReturnValue(err == CHIP_NO_ERROR, nullptr,
ChipLogError(Controller, "ICD HMAC KEY N2J_ByteArray error!: %" CHIP_ERROR_FORMAT, err.Format()));

Expand All @@ -89,6 +91,9 @@ jobject getICDClientInfo(JNIEnv *env, const char * icdClientInfoSign, jint jFabr
}

return jInfo;
}
}

chip::app::DefaultICDClientStorage * getICDClientStorage() { return &sICDClientStorage; }
chip::app::DefaultICDClientStorage * getICDClientStorage()
{
return &sICDClientStorage;
}
4 changes: 2 additions & 2 deletions src/controller/java/AndroidICDClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

#pragma once

#include <lib/support/JniReferences.h>
#include <app/icd/client/DefaultICDClientStorage.h>
#include <lib/support/JniReferences.h>

jobject getICDClientInfo(JNIEnv *env, const char * icdClientInfoSign, jint jFabricIndex);
jobject getICDClientInfo(JNIEnv * env, const char * icdClientInfoSign, jint jFabricIndex);

chip::app::DefaultICDClientStorage * getICDClientStorage();
1 change: 0 additions & 1 deletion src/controller/java/AndroidInteractionClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,6 @@ jint getFabricIndex(jlong devicePtr)
return static_cast<jint>(chipDevice->GetPeerScopedNodeId().GetFabricIndex());
}


/**
* Takes objects in attributePathList, converts them to app:AttributePathParams, and appends them to outAttributePathParamsList.
*/
Expand Down
3 changes: 1 addition & 2 deletions src/controller/java/CHIPICDClient-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

#include <platform/PlatformManager.h>

#define JNI_METHOD(RETURN, METHOD_NAME) \
extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipICDClient_##METHOD_NAME
#define JNI_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipICDClient_##METHOD_NAME

JNI_METHOD(jobject, getICDClientInfo)(JNIEnv * env, jobject self, jint jFabricIndex)
{
Expand Down
3 changes: 1 addition & 2 deletions src/controller/java/MatterICDClient-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

#include <platform/PlatformManager.h>

#define JNI_METHOD(RETURN, METHOD_NAME) \
extern "C" JNIEXPORT RETURN JNICALL Java_matter_controller_MatterICDClientImpl_##METHOD_NAME
#define JNI_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_matter_controller_MatterICDClientImpl_##METHOD_NAME

JNI_METHOD(jobject, getICDClientInfo)(JNIEnv * env, jobject self, jint jFabricIndex)
{
Expand Down

0 comments on commit 06453c7

Please sign in to comment.