validateTransportOptions static method
Validates a transport-option set against a stream's channel format.
Throws: ArgumentError for combinations liblsl does not support.
Implementation
static void validateTransportOptions(
Set<LSLTransportOptions> options,
LSLStreamInfo streamInfo,
) {
if (options.contains(LSLTransportOptions.syncBlocking) &&
streamInfo.channelFormat == LSLChannelFormat.string) {
throw ArgumentError(
'LSLTransportOptions.syncBlocking is incompatible with '
'string/variable-length channel formats',
);
}
if (options.contains(LSLTransportOptions.bufsizeInSamples) &&
options.contains(LSLTransportOptions.bufsizeInThousandths)) {
throw ArgumentError(
'bufsizeInSamples and bufsizeInThousandths are mutually exclusive '
'interpretations of maxBuffer',
);
}
}