Skip to content

Commit

Permalink
add OTA emberAfGetClusterServerEndpointIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhanw-google committed Jul 31, 2023
1 parent f71a48f commit 5583640
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/controller/java/CHIPDeviceController-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ JNI_METHOD(jbyteArray, createRootCertificate)
if (fabricId != nullptr)
{
jlong jfabricId = chip::JniReferences::GetInstance().LongToPrimitive(fabricId);
fabric = MakeOptional(static_cast<FabricId>(jfabricId));
fabric = MakeOptional(static_cast<FabricId>(jfabricId));
}

{
Expand Down Expand Up @@ -968,7 +968,7 @@ JNI_METHOD(jbyteArray, createIntermediateCertificate)
if (fabricId != nullptr)
{
jlong jfabricId = chip::JniReferences::GetInstance().LongToPrimitive(fabricId);
fabric = MakeOptional(static_cast<FabricId>(jfabricId));
fabric = MakeOptional(static_cast<FabricId>(jfabricId));
}

{
Expand Down Expand Up @@ -2357,3 +2357,21 @@ CHIP_ERROR N2J_NetworkLocation(JNIEnv * env, jstring ipAddress, jint port, jint
exit:
return err;
}

namespace {
constexpr EndpointId kSupportedEndpoint = 0;
} // anonymous namespace

/**
* Called by the OTA provider cluster server to determine an index
* into its array.
*/
uint16_t emberAfGetClusterServerEndpointIndex(EndpointId endpoint, ClusterId cluster, uint16_t fixedClusterServerEndpointCount)
{
if (endpoint == kSupportedEndpoint && cluster == chip::app::Clusters::OtaSoftwareUpdateProvider::Id)
{
return 0;
}

return UINT16_MAX;
}

0 comments on commit 5583640

Please sign in to comment.