Skip to content

Commit

Permalink
Rename OTA Server -> OTA Provider and OTA Client -> OTA Requestor (#7920
Browse files Browse the repository at this point in the history
)
  • Loading branch information
holbrookt authored and pull[bot] committed Sep 8, 2021
1 parent 4459372 commit 946a9f2
Show file tree
Hide file tree
Showing 46 changed files with 571 additions and 560 deletions.
26 changes: 13 additions & 13 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -1204,10 +1204,10 @@
]
},
{
"name": "OTA Software Update Server",
"name": "OTA Software Update Provider",
"code": 41,
"mfgCode": null,
"define": "OTA_SERVER_CLUSTER",
"define": "OTA_PROVIDER_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -1255,10 +1255,10 @@
]
},
{
"name": "OTA Software Update Server",
"name": "OTA Software Update Provider",
"code": 41,
"mfgCode": null,
"define": "OTA_SERVER_CLUSTER",
"define": "OTA_PROVIDER_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [
Expand Down Expand Up @@ -7204,10 +7204,10 @@
]
},
{
"name": "OTA Software Update Server",
"name": "OTA Software Update Provider",
"code": 41,
"mfgCode": null,
"define": "OTA_SERVER_CLUSTER",
"define": "OTA_PROVIDER_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -7255,10 +7255,10 @@
]
},
{
"name": "OTA Software Update Server",
"name": "OTA Software Update Provider",
"code": 41,
"mfgCode": null,
"define": "OTA_SERVER_CLUSTER",
"define": "OTA_PROVIDER_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -7298,16 +7298,16 @@
]
},
{
"name": "OTA Software Update Client",
"name": "OTA Software Update Requestor",
"code": 42,
"mfgCode": null,
"define": "OTA_CLIENT_CLUSTER",
"define": "OTA_REQUESTOR_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [],
"attributes": [
{
"name": "default ota server",
"name": "default ota provider",
"code": 0,
"mfgCode": null,
"side": "client",
Expand Down Expand Up @@ -7354,10 +7354,10 @@
]
},
{
"name": "OTA Software Update Client",
"name": "OTA Software Update Requestor",
"code": 42,
"mfgCode": null,
"define": "OTA_CLIENT_CLUSTER",
"define": "OTA_REQUESTOR_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5072,7 +5072,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En

} // namespace NetworkCommissioning

namespace OtaSoftwareUpdateServer {
namespace OtaSoftwareUpdateProvider {

void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv)
{
Expand Down Expand Up @@ -5151,7 +5151,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount)
{
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
wasHandled = emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestCallback(apCommandObj, updateToken, newVersion);
wasHandled =
emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(apCommandObj, updateToken, newVersion);
}
break;
}
Expand Down Expand Up @@ -5218,7 +5219,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
{
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
wasHandled =
emberAfOtaSoftwareUpdateServerClusterNotifyUpdateAppliedCallback(apCommandObj, updateToken, currentVersion);
emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(apCommandObj, updateToken, currentVersion);
}
break;
}
Expand All @@ -5231,8 +5232,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
uint32_t currentVersion;
/* TYPE WARNING: array array defaults to */ uint8_t * protocolsSupported;
const uint8_t * location;
uint8_t clientCanConsent;
chip::ByteSpan metadataForServer;
uint8_t requestorCanConsent;
chip::ByteSpan metadataForProvider;
bool argExists[9];

memset(argExists, 0, sizeof argExists);
Expand Down Expand Up @@ -5286,12 +5287,12 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
TLVUnpackError = aDataTlv.GetDataPtr(location);
break;
case 7:
TLVUnpackError = aDataTlv.Get(clientCanConsent);
TLVUnpackError = aDataTlv.Get(requestorCanConsent);
break;
case 8: {
const uint8_t * data = nullptr;
TLVUnpackError = aDataTlv.GetDataPtr(data);
metadataForServer = chip::ByteSpan(data, aDataTlv.GetLength());
metadataForProvider = chip::ByteSpan(data, aDataTlv.GetLength());
}
break;
default:
Expand All @@ -5314,22 +5315,22 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 9 == validArgumentCount)
{
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
wasHandled = emberAfOtaSoftwareUpdateServerClusterQueryImageCallback(
wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(
apCommandObj, vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported,
const_cast<uint8_t *>(location), clientCanConsent, metadataForServer);
const_cast<uint8_t *>(location), requestorCanConsent, metadataForProvider);
}
break;
}
default: {
// Unrecognized command ID, error status will apply.
chip::app::CommandPathParams returnStatusParam = { aEndpointId,
0, // GroupId
ZCL_OTA_SERVER_CLUSTER_ID, aCommandId,
ZCL_OTA_PROVIDER_CLUSTER_ID, aCommandId,
(chip::app::CommandPathFlags::kEndpointIdValid) };
apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound,
Protocols::SecureChannel::Id,
Protocols::InteractionModel::ProtocolCode::UnsupportedCommand);
ChipLogError(Zcl, "Unknown command %" PRIx8 " for cluster %" PRIx16, aCommandId, ZCL_OTA_SERVER_CLUSTER_ID);
ChipLogError(Zcl, "Unknown command %" PRIx8 " for cluster %" PRIx16, aCommandId, ZCL_OTA_PROVIDER_CLUSTER_ID);
return;
}
}
Expand All @@ -5339,7 +5340,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
{
chip::app::CommandPathParams returnStatusParam = { aEndpointId,
0, // GroupId
ZCL_OTA_SERVER_CLUSTER_ID, aCommandId,
ZCL_OTA_PROVIDER_CLUSTER_ID, aCommandId,
(chip::app::CommandPathFlags::kEndpointIdValid) };
apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand);
Expand All @@ -5350,7 +5351,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
}
}

} // namespace OtaSoftwareUpdateServer
} // namespace OtaSoftwareUpdateProvider

namespace OnOff {

Expand Down Expand Up @@ -6546,8 +6547,8 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC
case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
break;
case ZCL_OTA_SERVER_CLUSTER_ID:
clusters::OtaSoftwareUpdateServer::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
case ZCL_OTA_PROVIDER_CLUSTER_ID:
clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
break;
case ZCL_ON_OFF_CLUSTER_ID:
clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
emberAfNetworkCommissioningClusterInitCallback(endpoint);
break;
case ZCL_OTA_SERVER_CLUSTER_ID:
emberAfOtaSoftwareUpdateServerClusterInitCallback(endpoint);
case ZCL_OTA_PROVIDER_CLUSTER_ID:
emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint);
break;
case ZCL_OCCUPANCY_SENSING_CLUSTER_ID:
emberAfOccupancySensingClusterInitCallback(endpoint);
Expand Down Expand Up @@ -324,7 +324,7 @@ void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(Endpoi
// To prevent warning
(void) endpoint;
}
void __attribute__((weak)) emberAfOtaSoftwareUpdateServerClusterInitCallback(EndpointId endpoint)
void __attribute__((weak)) emberAfOtaSoftwareUpdateProviderClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
(void) endpoint;
Expand Down
63 changes: 32 additions & 31 deletions examples/all-clusters-app/all-clusters-common/gen/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ void emberAfMediaPlaybackClusterInitCallback(chip::EndpointId endpoint);
*/
void emberAfNetworkCommissioningClusterInitCallback(chip::EndpointId endpoint);

/** @brief OTA Software Update Server Cluster Init
/** @brief OTA Software Update Provider Cluster Init
*
* Cluster Init
*
* @param endpoint Endpoint that is being initialized
*/
void emberAfOtaSoftwareUpdateServerClusterInitCallback(chip::EndpointId endpoint);
void emberAfOtaSoftwareUpdateProviderClusterInitCallback(chip::EndpointId endpoint);

/** @brief Occupancy Sensing Cluster Init
*
Expand Down Expand Up @@ -2455,39 +2455,40 @@ EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallbac
void emberAfNetworkCommissioningClusterServerTickCallback(chip::EndpointId endpoint);

//
// OTA Software Update Server Cluster server
// OTA Software Update Provider Cluster server
//

/** @brief OTA Software Update Server Cluster Server Init
/** @brief OTA Software Update Provider Cluster Server Init
*
* Server Init
*
* @param endpoint Endpoint that is being initialized
*/
void emberAfOtaSoftwareUpdateServerClusterServerInitCallback(chip::EndpointId endpoint);
void emberAfOtaSoftwareUpdateProviderClusterServerInitCallback(chip::EndpointId endpoint);

/** @brief OTA Software Update Server Cluster Server Attribute Changed
/** @brief OTA Software Update Provider Cluster Server Attribute Changed
*
* Server Attribute Changed
*
* @param endpoint Endpoint that is being initialized
* @param attributeId Attribute that changed
*/
void emberAfOtaSoftwareUpdateServerClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
void emberAfOtaSoftwareUpdateProviderClusterServerAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId);

/** @brief OTA Software Update Server Cluster Server Manufacturer Specific Attribute Changed
/** @brief OTA Software Update Provider Cluster Server Manufacturer Specific Attribute Changed
*
* Server Manufacturer Specific Attribute Changed
*
* @param endpoint Endpoint that is being initialized
* @param attributeId Attribute that changed
* @param manufacturerCode Manufacturer Code of the attribute that changed
*/
void emberAfOtaSoftwareUpdateServerClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
uint16_t manufacturerCode);
void emberAfOtaSoftwareUpdateProviderClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
uint16_t manufacturerCode);

/** @brief OTA Software Update Server Cluster Server Message Sent
/** @brief OTA Software Update Provider Cluster Server Message Sent
*
* Server Message Sent
*
Expand All @@ -2498,11 +2499,11 @@ void emberAfOtaSoftwareUpdateServerClusterServerManufacturerSpecificAttributeCha
* @param message The message that was sent
* @param status The status of the sent message
*/
void emberAfOtaSoftwareUpdateServerClusterServerMessageSentCallback(const chip::MessageSendDestination & destination,
EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
EmberStatus status);
void emberAfOtaSoftwareUpdateProviderClusterServerMessageSentCallback(const chip::MessageSendDestination & destination,
EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
EmberStatus status);

/** @brief OTA Software Update Server Cluster Server Pre Attribute Changed
/** @brief OTA Software Update Provider Cluster Server Pre Attribute Changed
*
* server Pre Attribute Changed
*
Expand All @@ -2512,18 +2513,18 @@ void emberAfOtaSoftwareUpdateServerClusterServerMessageSentCallback(const chip::
* @param size Attribute size
* @param value Attribute value
*/
EmberAfStatus emberAfOtaSoftwareUpdateServerClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
EmberAfAttributeType attributeType,
uint16_t size, uint8_t * value);
EmberAfStatus emberAfOtaSoftwareUpdateProviderClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
EmberAfAttributeType attributeType,
uint16_t size, uint8_t * value);

/** @brief OTA Software Update Server Cluster Server Tick
/** @brief OTA Software Update Provider Cluster Server Tick
*
* server Tick
*
* @param endpoint Endpoint that is being served
*/
void emberAfOtaSoftwareUpdateServerClusterServerTickCallback(chip::EndpointId endpoint);
void emberAfOtaSoftwareUpdateProviderClusterServerTickCallback(chip::EndpointId endpoint);

//
// Occupancy Sensing Cluster server
Expand Down Expand Up @@ -4277,27 +4278,27 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(chip::app::Comm
uint32_t timeoutMs);

/**
* @brief OTA Software Update Server Cluster ApplyUpdateRequest Command callback
* @brief OTA Software Update Provider Cluster ApplyUpdateRequest Command callback
*/

bool emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken,
uint32_t newVersion);
bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken,
uint32_t newVersion);

/**
* @brief OTA Software Update Server Cluster NotifyUpdateApplied Command callback
* @brief OTA Software Update Provider Cluster NotifyUpdateApplied Command callback
*/

bool emberAfOtaSoftwareUpdateServerClusterNotifyUpdateAppliedCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken,
uint32_t currentVersion);
bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken,
uint32_t currentVersion);

/**
* @brief OTA Software Update Server Cluster QueryImage Command callback
* @brief OTA Software Update Provider Cluster QueryImage Command callback
*/

bool emberAfOtaSoftwareUpdateServerClusterQueryImageCallback(
bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(
chip::app::Command * commandObj, uint16_t vendorId, uint16_t productId, uint16_t imageType, uint16_t hardwareVersion,
uint32_t currentVersion, /* TYPE WARNING: array array defaults to */ uint8_t * protocolsSupported, uint8_t * location,
uint8_t clientCanConsent, chip::ByteSpan metadataForServer);
uint8_t requestorCanConsent, chip::ByteSpan metadataForProvider);

/**
* @brief On/off Cluster Off Command callback
Expand Down
Loading

0 comments on commit 946a9f2

Please sign in to comment.