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

Updating dotdot loader #1432

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Conversation

dhchandw
Copy link
Collaborator

@dhchandw dhchandw commented Sep 23, 2024

  • In zcl-loader-dotdot.js:

    • making sure discriminator ref is set correctly for all strings

    • making sure is_signed is set correctly for all numbers

    • dealing with subatomics (by processing them last)

    • picking up atomic size from length property

  • fixing incorrect value in zcl-loader-consecutive.test.js and adding string count test to zcl-loader.test.js

@@ -456,10 +456,11 @@ function prepareCluster(cluster, types, isExtension = false) {
*/
function prepareAtomic(type) {
let desc = type.$.name
let length = type.restriction?.[0]?.['type:length']?.[0]?.$?.value
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is pretty complicated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Due to the format of the XML object this is how deep the length property is. Would you suggest creating a helper for this?

src-electron/zcl/zcl-loader-dotdot.js Show resolved Hide resolved
src-electron/zcl/zcl-loader-dotdot.js Show resolved Hide resolved
a.name.endsWith('u') ||
!a.name.includes('int')
? 0
: 1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we do something similar on the zcl-loader-silabs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

XMLs loaded through zcl-loader-silabs (Matter/Zigbee) expect the isSigned field to be specified in the XML. If not they do some regex matching - /^int[0-9]{1,2}s?$/.test(a.$.name).

test/zcl-loader-consecutive.test.js Show resolved Hide resolved
test/zcl-loader.test.js Show resolved Hide resolved
	* making sure discriminator ref is set correctly for all strings

	* making sure is_signed is set correctly for all numbers

	* dealing with subatomics (by processing them last)

	* picking up atomic size from length property

fixing incorrect value in zcl-loader-consecutive.test.js and adding string count test in zcl-loader.test.js
@dhchandw dhchandw merged commit 8c50f6e into project-chip:master Sep 25, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants