Skip to content

Commit

Permalink
Modify Java helper (project-chip#1092)
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhaengHeo authored Aug 4, 2023
1 parent c0a1d10 commit 4e86527
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src-electron/generator/matter/controller/java/templates/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,29 @@ function asJniBasicType(type, useBoxedTypes) {
return 'jbyteArray';
} else if (StringHelper.isCharString(type)) {
return 'jstring';
} else {
if (useBoxedTypes) {
return 'jobject';
}
return convertBasicCTypeToJniType(
ChipTypesHelper.asBasicType(this.chipType)
);
} else if (useBoxedTypes) {
return 'jobject';
}
function fn(pkgId) {
const options = { hash: {} };
return zclHelper.asUnderlyingZclType
.call(this, type, options)
.then((zclType) => {
return convertBasicCTypeToJniType(
ChipTypesHelper.asBasicType(zclType),
false
);
});
}

const promise = templateUtil
.ensureZclPackageIds(this)
.then(fn.bind(this))
.catch((err) => {
console.log(err);
throw err;
});
return templateUtil.templatePromise(this.global, promise);
}

function asJniSignatureBasic(type, useBoxedTypes) {
Expand Down

0 comments on commit 4e86527

Please sign in to comment.