getModuleName static method
- int index
Retrieves the name of the specified license module.
param index Index of the module, starting from 0. return The license module name. throws BiosealException An error has occurred during Bioseal Library execution.
Implementation
static String getModuleName(int index) {
Pointer<Char> pName = calloc.allocate(256);
Pointer<Int> pNameSize = calloc.allocate(1);
pNameSize[0] = 256;
try {
var err = biosealSDK.id3BiosealLicense_GetModuleName(index, pName, pNameSize);
if (err == BiosealError.insufficientBuffer.value) {
calloc.free(pName);
pName = calloc.allocate(pNameSize.value);
err = biosealSDK.id3BiosealLicense_GetModuleName(index, pName, pNameSize);
if (err != BiosealError.success.value) {
throw BiosealException(err);
}
}
final vName = utf8.decode(Uint8List.fromList(pName.cast<Uint8>().asTypedList(pNameSize.value)));
return vName;
} finally {
calloc.free(pName);
calloc.free(pNameSize);
}
}