setMockData method
Set mock data for this data source.
Useful for injecting custom SenseData into live data sources for testing or UI previews. Only data types supported by the source may be accepted.
Only positions are currently supported for this method. Use pushData to inject other data types.
Parameters
senseData: The SenseData to set as mock data.
Returns
- GemError.success on success.
- GemError.notSupported if mock data is not supported by this source or the provided type is not accepted.
- Other GemError values on failure.
Implementation
GemError setMockData(final SenseData senseData) {
if (senseData is! SenseDataImpl) {
return GemError.invalidInput;
}
final OperationResult resultString = objectMethod(
pointerId,
'DataSourceContainer',
'setMockData',
args: <String, Object>{
'type': senseData.type.id,
'data': senseData.toJson(),
},
);
return GemErrorExtension.fromCode(resultString['result']);
}