Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Github: ZAP#1438
  • Loading branch information
brdandu committed Oct 29, 2024
1 parent eacbfb4 commit 39c5c6f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
16 changes: 10 additions & 6 deletions src-electron/zcl/zcl-loader-silabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,20 @@ function prepareAtomic(a) {
isDiscrete: a.$.discrete == 'true',
isComposite: a.$.composite == 'true',
isSigned: a.$.signed == 'true',
isString: a.$.string == 'true' || a.$.name.toLowerCase().includes('string'),
isString:
a.$.string == 'true' ||
a.$.name.toLowerCase() == 'char_string' ||
a.$.name.toLowerCase() == 'long_char_string' ||
a.$.name.toLowerCase() == 'octet_string' ||
a.$.name.toLowerCase() == 'long_octet_string',
isLong:
a.$.long == 'true' ||
(a.$.name.toLowerCase().includes('long') &&
a.$.name.toLowerCase().includes('string')),
a.$.name.toLowerCase() == 'long_char_string' ||
a.$.name.toLowerCase() == 'long_octet_string',
isChar:
a.$.char == 'true' ||
(a.$.name.toLowerCase().includes('long') &&
a.$.name.toLowerCase().includes('string') &&
a.$.name.toLowerCase().includes('char')),
a.$.name.toLowerCase() == 'char_string' ||
a.$.name.toLowerCase() == 'long_char_string',
isFloat:
a.$.float == 'true' ||
a.$.name.toLowerCase() === 'single' ||
Expand Down
14 changes: 6 additions & 8 deletions test/gen-matter-1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,12 @@ test(
)

// Testing base types based on xml defining them
expect(simpleTest).toContain('Baseline type for bitmap8 : int8u')
expect(simpleTest).toContain('Baseline type for bitmap32 : int32u')
expect(simpleTest).toContain('Baseline type for bitmap64 : int64u')
expect(simpleTest).toContain('Baseline type for enum8 : int8u')
expect(simpleTest).toContain('Baseline type for enum16 : int16u')
expect(simpleTest).toContain(
'Baseline type for ipv6adr : long_octet_string'
)
expect(simpleTest).toContain('Base type for bitmap8 : int8u')
expect(simpleTest).toContain('Base type for bitmap32 : int32u')
expect(simpleTest).toContain('Base type for bitmap64 : int64u')
expect(simpleTest).toContain('Base type for enum8 : int8u')
expect(simpleTest).toContain('Base type for enum16 : int16u')
expect(simpleTest).toContain('Base type for ipv6adr : long_octet_string')

let deviceType = genResult.content['device-types.txt']
expect(deviceType).toContain(
Expand Down
4 changes: 2 additions & 2 deletions test/gen-template/matter/simple-test.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ ExternalAddon : {{test_external_addon_all_commands_helper}}
ExternalAddon : {{test_external_addon_all_events_helper}}
ExternalAddon : {{test_external_addon_helper}}

// Extract all baseline types:
// Extract all Base types:
{{#zcl_atomics}}
{{#if baseType}}
Baseline type for {{name}} : {{baseType}}
Base type for {{name}} : {{baseType}}
{{/if}}
{{/zcl_atomics}}

0 comments on commit 39c5c6f

Please sign in to comment.