@@ -171,80 +171,6 @@ EmberAfStatus emberAfReadManufacturerSpecificClientAttribute(EndpointId endpoint
171
171
return emAfReadAttribute (endpoint, cluster, attributeID, CLUSTER_MASK_CLIENT, manufacturerCode, dataPtr, readLength, NULL );
172
172
}
173
173
174
- bool emberAfReadSequentialAttributesAddToResponse (EndpointId endpoint, ClusterId clusterId, AttributeId startAttributeId,
175
- uint8_t mask, uint16_t manufacturerCode, uint8_t maxAttributeIds,
176
- bool includeAccessControl)
177
- {
178
- uint16_t i;
179
- uint16_t discovered = 0 ;
180
- uint16_t skipped = 0 ;
181
- uint16_t total = 0 ;
182
-
183
- EmberAfCluster * cluster = emberAfFindClusterWithMfgCode (endpoint, clusterId, mask, manufacturerCode);
184
-
185
- EmberAfAttributeSearchRecord record;
186
- record.endpoint = endpoint;
187
- record.clusterId = clusterId;
188
- record.clusterMask = mask;
189
- record.attributeId = startAttributeId;
190
- record.manufacturerCode = manufacturerCode;
191
-
192
- // If we don't have the cluster or it doesn't match the search, we're done.
193
- if (cluster == NULL || !emAfMatchCluster (cluster, &record))
194
- {
195
- return true ;
196
- }
197
-
198
- for (i = 0 ; i < cluster->attributeCount ; i++)
199
- {
200
- EmberAfAttributeMetadata * metadata = &cluster->attributes [i];
201
-
202
- // If the cluster is not manufacturer-specific, an attribute is considered
203
- // only if its manufacturer code matches that of the command (which may be
204
- // unset).
205
- if (!emberAfClusterIsManufacturerSpecific (cluster))
206
- {
207
- record.attributeId = metadata->attributeId ;
208
- if (!emAfMatchAttribute (cluster, metadata, &record))
209
- {
210
- continue ;
211
- }
212
- }
213
-
214
- if (metadata->attributeId < startAttributeId)
215
- {
216
- skipped++;
217
- }
218
- else if (discovered < maxAttributeIds)
219
- {
220
- emberAfPutInt32uInResp (metadata->attributeId );
221
- emberAfPutInt8uInResp (metadata->attributeType );
222
- if (includeAccessControl)
223
- {
224
- // bit 0 : Readable <-- All our attributes are readable
225
- // bit 1 : Writable <-- The only thing we track in the attribute metadata mask
226
- // bit 2 : Reportable <-- All our attributes are reportable
227
- emberAfPutInt8uInResp ((metadata->mask & ATTRIBUTE_MASK_WRITABLE) ? 0x07 : 0x05 );
228
- }
229
- discovered++;
230
- }
231
- else
232
- {
233
- // MISRA requires ..else if.. to have terminating else.
234
- }
235
- total++;
236
- }
237
-
238
- // We are finished if there are no more attributes to find, which means the
239
- // number of attributes discovered plus the number skipped equals the total
240
- // attributes in the cluster. For manufacturer-specific clusters, the total
241
- // includes all attributes in the cluster. For standard ZCL clusters, if the
242
- // the manufacturer code is set, the total is the number of attributes that
243
- // match the manufacturer code. Otherwise, the total is the number of
244
- // standard ZCL attributes in the cluster.
245
- return (discovered + skipped == total);
246
- }
247
-
248
174
static void emberAfAttributeDecodeAndPrintCluster (ClusterId cluster, uint16_t mfgCode)
249
175
{
250
176
#if defined(EMBER_AF_PRINT_ENABLE) && defined(EMBER_AF_PRINT_ATTRIBUTES)
@@ -542,11 +468,10 @@ EmberAfStatus emAfWriteAttribute(EndpointId endpoint, ClusterId cluster, Attribu
542
468
{
543
469
EmberAfAttributeMetadata * metadata = NULL ;
544
470
EmberAfAttributeSearchRecord record;
545
- record.endpoint = endpoint;
546
- record.clusterId = cluster;
547
- record.clusterMask = mask;
548
- record.attributeId = attributeID;
549
- record.manufacturerCode = manufacturerCode;
471
+ record.endpoint = endpoint;
472
+ record.clusterId = cluster;
473
+ record.clusterMask = mask;
474
+ record.attributeId = attributeID;
550
475
emAfReadOrWriteAttribute (&record, &metadata,
551
476
NULL , // buffer
552
477
0 , // buffer size
@@ -689,12 +614,11 @@ EmberAfStatus emAfReadAttribute(EndpointId endpoint, ClusterId cluster, Attribut
689
614
EmberAfAttributeMetadata * metadata = NULL ;
690
615
EmberAfAttributeSearchRecord record;
691
616
EmberAfStatus status;
692
- record.endpoint = endpoint;
693
- record.clusterId = cluster;
694
- record.clusterMask = mask;
695
- record.attributeId = attributeID;
696
- record.manufacturerCode = manufacturerCode;
697
- status = emAfReadOrWriteAttribute (&record, &metadata, dataPtr, readLength,
617
+ record.endpoint = endpoint;
618
+ record.clusterId = cluster;
619
+ record.clusterMask = mask;
620
+ record.attributeId = attributeID;
621
+ status = emAfReadOrWriteAttribute (&record, &metadata, dataPtr, readLength,
698
622
false ); // write?
699
623
700
624
if (status == EMBER_ZCL_STATUS_SUCCESS)
0 commit comments