Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding exceptions to if_basic_attribute #975

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const zclUtil = require(zapPath + 'util/zcl-util.js');

const characterStringTypes = ['CHAR_STRING', 'LONG_CHAR_STRING'];
const octetStringTypes = ['OCTET_STRING', 'LONG_OCTET_STRING'];
const basicAttributeExceptionList = ['vendor_id'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this an exception ... we would want a comment explaining.

I cannot figure out why vendor_id, fabric_idx and group_id are not basic and had to code this into project-chip/connectedhomeip#25786 ....

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is an existing problem may it be jinja or handlebar templates. I believe the list is a lot longer than that. 'ActionId', 'FabricIndex', 'Percent', 'EndpointId', 'GroupId', 'VendorId', 'Percent100ths', 'ClusterId', 'AttributeId', 'FieldId', 'EventId', 'CommandId', 'TransactionId', 'DeviceTypeId', 'StatusCode', 'DataVersion', 'EventNumber', 'FabricId', 'NodeId'


function convertBasicCTypeToJavaType(cType) {
switch (cType) {
Expand Down Expand Up @@ -443,7 +444,12 @@ function incrementDepth(depth) {
*/
async function if_basic_attribute(type, clusterId, options) {
let struct = null;
if (this.isNullable || this.isOptional || this.isArray) {
if (
this.isNullable ||
this.isOptional ||
this.isArray ||
basicAttributeExceptionList.includes(type)
) {
return options.inverse(this);
} else {
let packageIds = await templateUtil.ensureZclPackageIds(this);
Expand Down