Configuration

After generating the code, you will get a java class in the deviceservices called <Gateway App Name>DeviceSetupFactory. In the example you can see how to set the configuration for each sensor or actuator usage.

    public static DigitalGroveActuatorDeviceDriver.DeviceSetup getSetupForAlarm() {
        //DA-START:org.gs.iot.sample.monitoring.gateway.hal.GatewayAppDeviceSetupFactory.getSetupForAlarm.DeviceSetup:DA-START
        DigitalConnection connection = new DigitalConnection();
        connection.setPinNumber(25);
        return new DigitalGroveActuatorDeviceDriver.DeviceSetup(connection);
        //DA-ELSE:org.gs.iot.sample.monitoring.gateway.hal.GatewayAppDeviceSetupFactory.getSetupForAlarm.DeviceSetup:DA-ELSE
        //return null;
        //DA-END:org.gs.iot.sample.monitoring.gateway.hal.GatewayAppDeviceSetupFactory.getSetupForAlarm.DeviceSetup:DA-END
    }

    public static DigitalLightTSL2561GroveDeviceDriver.DeviceSetup getSetupForIlluminance() {
        //DA-START:org.gs.iot.sample.monitoring.gateway.hal.GatewayAppDeviceSetupFactory.getSetupForIlluminance.DeviceSetup:DA-START
        I2cConnection connection = new I2cConnection();
        connection.seti2cAddress(0);
        connection.seti2cBus(0);
        return new DigitalLightTSL2561GroveDeviceDriver.DeviceSetup(connection);
        //DA-ELSE:org.gs.iot.sample.monitoring.gateway.hal.GatewayAppDeviceSetupFactory.getSetupForIlluminance.DeviceSetup:DA-ELSE
        //return null;
    }