Ignition 8.3
I try to check a password parameter has the minimal lenght in a DeviceExtensionPoint
But at gateway startup I have a NPE on opcua module, on line Secret.create(deviceContext.getGatewayContext() because the deviceContext is NULL.
How can we retrieve the GatewayContext in validate method ?
or is there another way th chceck the password length ?
```
public class MyDevice3ExtensionPoint extends DeviceExtensionPoint {
@Override
protected Device createDevice(
DeviceContext context, DeviceProfileConfig profileConfig, DeviceDriverSNMPV3SettingsResource deviceConfig) {
deviceContext = context;
deviceDriver = new DeviceDriverSNMPV3(context,deviceConfig);
return deviceDriver;
}
...
@Override
protected void validate(DeviceDriverSNMPV3SettingsResource config, Builder errors) {
try {
errors.checkField
(Secret.create(deviceContext.getGatewayContext(), config.PrivPassphrase()).getPlaintext().getAsString().length()>=8,
"Privacy.PrivProtocol",
"PrivProtocol requires to have a minimum length of 8 bytes."
);
} catch (SecretException e) {
throw new RuntimeException(e);
}
}
```