Skip to content

Commit 1323ca4

Browse files
[Fixed] OTAServerDelegate class for vendor logic (project-chip#7537)
* OTAServerDelegate class for vendor logic (project-chip#6476) * OTAServerDelegate class for vendor logic - define OTAServerDelegate class for implementing vendor OTA Server logic - add some common logic for OTA Server Cluster commands - use OTA_SERVER_CLUSTER_EXAMPLE_IMPL to conditionally build example logic - add OTA Server Cluster to all-clusters-app and chip-tool - fix AnnounceOTAServer command direction * add build macros to all-clusters-app esp32 build files * use virtual delegate methods instead of static singleton * fix whitespace * add OTA Server to all-clusters-app, remove ota-client callbacks ota-client response callbacks are automatically generated now * generated files * remove src/darwin edits * edit zap files to include just ota clusters * regenerate gen files after zap fix * add multiple endpoint support and EMBER_ZCL_STATUS_INVALID_ARGUMENT * remove OTA Server Cluster from all-clusters-app Endpoint 1 - There should only be one OTA Server Cluster, in endpoint 0 * fix darwin tests - enable Cluster Revision attribute reporting for OTA Server Cluster in all-clusters-app - change darwin test to use endpoint 0 instead of endpoint 1 * edit helper.js in darwin to fix OTA Server test - note: tv-app files were also modified and tv-app build is failing * generated files after merge conflict * resolve merge conflicts + regen * default destructor for OTAServerDelegate Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com> * error logging and value change for EMBER_ZCL_STATUS_INVALID_ARGUMENT * regenerate * regenerated files after merge conflict fix * add generated tv-app files * Revert "add generated tv-app files" This reverts commit 48acb90. Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com> * change logging types and regenerate files * regenerate after merge conflict * fix namespacing * regenerate files * wrap SetDelegate() in namespace scope Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com>
1 parent 18a5a40 commit 1323ca4

31 files changed

+1846
-232
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

+97-12
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,100 @@
11881188
}
11891189
]
11901190
},
1191+
{
1192+
"name": "OTA Software Update Server",
1193+
"code": 41,
1194+
"mfgCode": null,
1195+
"define": "OTA_SERVER_CLUSTER",
1196+
"side": "client",
1197+
"enabled": 0,
1198+
"commands": [
1199+
{
1200+
"name": "QueryImage",
1201+
"code": 0,
1202+
"mfgCode": null,
1203+
"source": "client",
1204+
"incoming": 1,
1205+
"outgoing": 1
1206+
},
1207+
{
1208+
"name": "ApplyUpdateRequest",
1209+
"code": 1,
1210+
"mfgCode": null,
1211+
"source": "client",
1212+
"incoming": 1,
1213+
"outgoing": 1
1214+
},
1215+
{
1216+
"name": "NotifyUpdateApplied",
1217+
"code": 2,
1218+
"mfgCode": null,
1219+
"source": "client",
1220+
"incoming": 1,
1221+
"outgoing": 1
1222+
}
1223+
],
1224+
"attributes": [
1225+
{
1226+
"name": "cluster revision",
1227+
"code": 65533,
1228+
"mfgCode": null,
1229+
"side": "client",
1230+
"included": 1,
1231+
"storageOption": "RAM",
1232+
"singleton": 0,
1233+
"bounded": 0,
1234+
"defaultValue": "0x0001",
1235+
"reportable": 0,
1236+
"minInterval": 0,
1237+
"maxInterval": 65344,
1238+
"reportableChange": 0
1239+
}
1240+
]
1241+
},
1242+
{
1243+
"name": "OTA Software Update Server",
1244+
"code": 41,
1245+
"mfgCode": null,
1246+
"define": "OTA_SERVER_CLUSTER",
1247+
"side": "server",
1248+
"enabled": 1,
1249+
"commands": [
1250+
{
1251+
"name": "QueryImageResponse",
1252+
"code": 3,
1253+
"mfgCode": null,
1254+
"source": "server",
1255+
"incoming": 1,
1256+
"outgoing": 1
1257+
},
1258+
{
1259+
"name": "ApplyUpdateRequestResponse",
1260+
"code": 4,
1261+
"mfgCode": null,
1262+
"source": "server",
1263+
"incoming": 1,
1264+
"outgoing": 1
1265+
}
1266+
],
1267+
"attributes": [
1268+
{
1269+
"name": "cluster revision",
1270+
"code": 65533,
1271+
"mfgCode": null,
1272+
"side": "server",
1273+
"included": 1,
1274+
"storageOption": "RAM",
1275+
"singleton": 0,
1276+
"bounded": 0,
1277+
"defaultValue": "0x0001",
1278+
"reportable": 1,
1279+
"minInterval": 0,
1280+
"maxInterval": 65344,
1281+
"reportableChange": 0
1282+
}
1283+
]
1284+
},
11911285
{
11921286
"name": "General Commissioning",
11931287
"code": 48,
@@ -6952,7 +7046,7 @@
69527046
"mfgCode": null,
69537047
"define": "OTA_SERVER_CLUSTER",
69547048
"side": "server",
6955-
"enabled": 1,
7049+
"enabled": 0,
69567050
"commands": [
69577051
{
69587052
"name": "QueryImageResponse",
@@ -7051,17 +7145,8 @@
70517145
"mfgCode": null,
70527146
"define": "OTA_CLIENT_CLUSTER",
70537147
"side": "server",
7054-
"enabled": 1,
7055-
"commands": [
7056-
{
7057-
"name": "AnnounceOtaServer",
7058-
"code": 0,
7059-
"mfgCode": null,
7060-
"source": "server",
7061-
"incoming": 0,
7062-
"outgoing": 1
7063-
}
7064-
],
7148+
"enabled": 0,
7149+
"commands": [],
70657150
"attributes": [
70667151
{
70677152
"name": "cluster revision",

examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
110110
case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID:
111111
emberAfNetworkCommissioningClusterInitCallback(endpoint);
112112
break;
113-
case ZCL_OTA_CLIENT_CLUSTER_ID:
114-
emberAfOtaSoftwareUpdateClientClusterInitCallback(endpoint);
115-
break;
116113
case ZCL_OTA_SERVER_CLUSTER_ID:
117114
emberAfOtaSoftwareUpdateServerClusterInitCallback(endpoint);
118115
break;
@@ -308,11 +305,6 @@ void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(Endpoi
308305
// To prevent warning
309306
(void) endpoint;
310307
}
311-
void __attribute__((weak)) emberAfOtaSoftwareUpdateClientClusterInitCallback(EndpointId endpoint)
312-
{
313-
// To prevent warning
314-
(void) endpoint;
315-
}
316308
void __attribute__((weak)) emberAfOtaSoftwareUpdateServerClusterInitCallback(EndpointId endpoint)
317309
{
318310
// To prevent warning

examples/all-clusters-app/all-clusters-common/gen/callback.h

-79
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,6 @@ void emberAfMediaPlaybackClusterInitCallback(chip::EndpointId endpoint);
256256
*/
257257
void emberAfNetworkCommissioningClusterInitCallback(chip::EndpointId endpoint);
258258

259-
/** @brief OTA Software Update Client Cluster Init
260-
*
261-
* Cluster Init
262-
*
263-
* @param endpoint Endpoint that is being initialized
264-
*/
265-
void emberAfOtaSoftwareUpdateClientClusterInitCallback(chip::EndpointId endpoint);
266-
267259
/** @brief OTA Software Update Server Cluster Init
268260
*
269261
* Cluster Init
@@ -2295,77 +2287,6 @@ EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallbac
22952287
*/
22962288
void emberAfNetworkCommissioningClusterServerTickCallback(chip::EndpointId endpoint);
22972289

2298-
//
2299-
// OTA Software Update Client Cluster server
2300-
//
2301-
2302-
/** @brief OTA Software Update Client Cluster Server Init
2303-
*
2304-
* Server Init
2305-
*
2306-
* @param endpoint Endpoint that is being initialized
2307-
*/
2308-
void emberAfOtaSoftwareUpdateClientClusterServerInitCallback(chip::EndpointId endpoint);
2309-
2310-
/** @brief OTA Software Update Client Cluster Server Attribute Changed
2311-
*
2312-
* Server Attribute Changed
2313-
*
2314-
* @param endpoint Endpoint that is being initialized
2315-
* @param attributeId Attribute that changed
2316-
*/
2317-
void emberAfOtaSoftwareUpdateClientClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
2318-
2319-
/** @brief OTA Software Update Client Cluster Server Manufacturer Specific Attribute Changed
2320-
*
2321-
* Server Manufacturer Specific Attribute Changed
2322-
*
2323-
* @param endpoint Endpoint that is being initialized
2324-
* @param attributeId Attribute that changed
2325-
* @param manufacturerCode Manufacturer Code of the attribute that changed
2326-
*/
2327-
void emberAfOtaSoftwareUpdateClientClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
2328-
chip::AttributeId attributeId,
2329-
uint16_t manufacturerCode);
2330-
2331-
/** @brief OTA Software Update Client Cluster Server Message Sent
2332-
*
2333-
* Server Message Sent
2334-
*
2335-
* @param type The type of message sent
2336-
* @param destination The destination to which the message was sent
2337-
* @param apsFrame The APS frame for the message
2338-
* @param msgLen The length of the message
2339-
* @param message The message that was sent
2340-
* @param status The status of the sent message
2341-
*/
2342-
void emberAfOtaSoftwareUpdateClientClusterServerMessageSentCallback(const chip::MessageSendDestination & destination,
2343-
EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
2344-
EmberStatus status);
2345-
2346-
/** @brief OTA Software Update Client Cluster Server Pre Attribute Changed
2347-
*
2348-
* server Pre Attribute Changed
2349-
*
2350-
* @param endpoint Endpoint that is being initialized
2351-
* @param attributeId Attribute to be changed
2352-
* @param attributeType Attribute type
2353-
* @param size Attribute size
2354-
* @param value Attribute value
2355-
*/
2356-
EmberAfStatus emberAfOtaSoftwareUpdateClientClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
2357-
chip::AttributeId attributeId,
2358-
EmberAfAttributeType attributeType,
2359-
uint16_t size, uint8_t * value);
2360-
2361-
/** @brief OTA Software Update Client Cluster Server Tick
2362-
*
2363-
* server Tick
2364-
*
2365-
* @param endpoint Endpoint that is being served
2366-
*/
2367-
void emberAfOtaSoftwareUpdateClientClusterServerTickCallback(chip::EndpointId endpoint);
2368-
23692290
//
23702291
// OTA Software Update Server Cluster server
23712292
//

0 commit comments

Comments
 (0)