Package com.tinkerforge

Examples of com.tinkerforge.BrickletIO4$Configuration


    }
    MBrickletIO4 bricklet = getMbrick();
    if (bricklet == null) {
      logger.error("{} No bricklet found for DigitalSensor: {} ", LoggerConstants.TFINIT, subId);
    } else {
      BrickletIO4 brickletIO4 = bricklet.getTinkerforgeDevice();
      try {
        logger.debug("{} setting InterruptListener for DigitalSensorIO4: {} ", LoggerConstants.TFINIT,
            subId);
        listener = new InterruptListener();
        brickletIO4.addInterruptListener(listener);
        brickletIO4.setConfiguration((short) mask, BrickletIO4.DIRECTION_IN,
            isPullUpResistorEnabled());
        fetchSensorValue();
      } catch (TimeoutException e) {
        TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
      } catch (NotConnectedException e) {
View Full Code Here


   * <!-- end-user-doc -->
   * @generated
   */
  public void setTinkerforgeDevice(BrickletIO4 newTinkerforgeDevice)
  {
    BrickletIO4 oldTinkerforgeDevice = tinkerforgeDevice;
    tinkerforgeDevice = newTinkerforgeDevice;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBRICKLET_IO4__TINKERFORGE_DEVICE, oldTinkerforgeDevice, tinkerforgeDevice));
  }
View Full Code Here

      if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("debouncePeriod"))) {
        setDebouncePeriod(tfConfig.getDebouncePeriod());
      }
    }
    try {
      tinkerforgeDevice = new BrickletIO4(getUid(), getIpConnection());
      logger.debug("{} BrickletIO4 setting debouncePeriod to {}", LoggerConstants.TFINIT,
          getDebouncePeriod());
      tinkerforgeDevice.setDebouncePeriod(getDebouncePeriod());
      tinkerforgeDevice.setInterrupt((short) 15);
    } catch (TimeoutException e) {
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated NOT
   */
  public void turnDigital(HighLowValue digitalState) {
    BrickletIO4 bricklet = getMbrick().getTinkerforgeDevice();
    try {
      if (digitalState == HighLowValue.HIGH) {
        bricklet.setSelectedValues((short) mask, (short) mask);
      } else if (digitalState == HighLowValue.LOW) {
        bricklet.setSelectedValues((short) mask, (short) 0);
      } else {
        logger.error("{} unkown digitalState {}", LoggerConstants.TFMODELUPDATE, digitalState);
      }
      setDigitalState(digitalState);
    } catch (TimeoutException e) {
View Full Code Here

    }

    @Test
    public void testSubset()
    {
        Configuration subset = config.subset("dictionary");
        Iterator<String> keys = subset.getKeys();

        String key = keys.next();
        assertEquals("1st key", "key1", key);
        assertEquals("1st value", "value1", subset.getString(key));

        key = keys.next();
        assertEquals("2nd key", "key2", key);
        assertEquals("2nd value", "value2", subset.getString(key));

        key = keys.next();
        assertEquals("3rd key", "key3", key);
        assertEquals("3rd value", "value3", subset.getString(key));

        assertFalse("more than 3 properties founds", keys.hasNext());
    }
View Full Code Here

        assertFalse("empty array", list.isEmpty());
        assertEquals("size", 2, list.size());

        // 1st dictionary
        ObjectAssert.assertInstanceOf("the dict element is not parsed as a Configuration", Configuration.class, list.get(0));
        Configuration conf1 = (Configuration) list.get(0);
        assertFalse("configuration 1 is empty", conf1.isEmpty());
        assertEquals("configuration element", "bar", conf1.getProperty("foo"));

        // 2nd dictionary
        ObjectAssert.assertInstanceOf("the dict element is not parsed as a Configuration", Configuration.class, list.get(1));
        Configuration conf2 = (Configuration) list.get(1);
        assertFalse("configuration 2 is empty", conf2.isEmpty());
        assertEquals("configuration element", "value", conf2.getProperty("key"));
    }
View Full Code Here

        EasyMock.replay(detector);
        ReloadingController controller = new ReloadingController(detector);
        BasicConfigurationBuilder<Configuration> builder =
                new BasicConfigurationBuilder<Configuration>(
                        PropertiesConfiguration.class);
        Configuration configuration = builder.getConfiguration();

        builder.connectToReloadingController(controller);
        controller.checkForReloading(null);
        assertTrue("Not in reloading state", controller.isInReloadingState());
        assertNotSame("No new configuration created", configuration,
View Full Code Here

        assertFalse("empty array", list.isEmpty());
        assertEquals("size", 2, list.size());

        // 1st dictionary
        ObjectAssert.assertInstanceOf("the dict element is not parsed as a Configuration", Configuration.class, list.get(0));
        Configuration conf1 = (Configuration) list.get(0);
        assertFalse("configuration 1 is empty", conf1.isEmpty());
        assertEquals("configuration element", "bar", conf1.getProperty("foo"));

        // 2nd dictionary
        ObjectAssert.assertInstanceOf("the dict element is not parsed as a Configuration", Configuration.class, list.get(1));
        Configuration conf2 = (Configuration) list.get(1);
        assertFalse("configuration 2 is empty", conf2.isEmpty());
        assertEquals("configuration element", "value", conf2.getProperty("key"));
    }
View Full Code Here

    public ConfigurationBuilder<? extends Configuration> getConfigurationBuilder(
            ConfigurationDeclaration decl) throws ConfigurationException
    {
        ConfigurationBuilder<? extends Configuration> multiBuilder =
                super.getConfigurationBuilder(decl);
        Configuration wrapConfig = createWrapperConfiguration(multiBuilder);
        return createWrapperBuilder(multiBuilder, wrapConfig);
    }
View Full Code Here

     * Set up instance variables required by this test case.
     */
    @Before
    public void setUp() throws Exception
    {
        Configuration configuration = createConfiguration();

        for (int i = 0; i < properties.length; i++)
        {
            configuration.setProperty(properties[i], values[i]);
        }

        for (int element : intArray) {
            configuration.addProperty("intIndexed", new Integer(element));
        }

        for (String element : stringArray) {
            configuration.addProperty("stringIndexed", element);
        }

        List<String> list = Arrays.asList(stringArray);
        configuration.addProperty("listIndexed", list);

        bean = new ConfigurationDynaBean(configuration);

        bean.set("listIndexed", list);
        bean.set("intArray", intArray);
View Full Code Here

TOP

Related Classes of com.tinkerforge.BrickletIO4$Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.