Class W1Master


  • public class W1Master
    extends Object
    Author:
    Peter Schuebl
    • Constructor Detail

      • W1Master

        public W1Master()
        Create an instance of the W1 master. Typically there should only be one master.

        java.util.ServiceLoader is used to add device support for individual devices.

      • W1Master

        public W1Master​(ClassLoader classloader)
        Create an instance of the W1 master. Typically there should only be one master.

        java.util.ServiceLoader is used to add device support for individual devices.

        Parameters:
        classloader - This ClassLoader will be used for the ServiceLoader to determine supported device types.
      • W1Master

        public W1Master​(String masterDir)
        Create a master with a different default dir e.g. for tests.
        Parameters:
        masterDir -
      • W1Master

        public W1Master​(String masterDir,
                        ClassLoader classloader)
        Create a master with a different default dir e.g. for tests.
        Parameters:
        masterDir -
        classloader - This ClassLoader will be used for the ServiceLoader to determine supported device types.
    • Method Detail

      • checkDeviceChanges

        public void checkDeviceChanges()
      • getDeviceTypes

        public Collection<W1DeviceType> getDeviceTypes()
        Gets a list of the available device types.
        Returns:
      • getDeviceIDs

        public List<String> getDeviceIDs()
        Gets a list of all registered slave device ids.
        Returns:
        list of slave ids, can be empty, never null.
      • getDevices

        public List<W1Device> getDevices()
        Get the list of available devices.
        Returns:
        returns an unmodifiable list of W1Devices.
      • getDevices

        public <T extends W1DeviceList<T> getDevices​(int deviceFamilyId)
      • getDeviceById

        public <T extends W1Device> T getDeviceById​(String id)
        Get a single device by it's ID string
        Parameters:
        id - (string)
        Returns:
        W1 device instance
      • getDevices

        public <T> List<T> getDevices​(Class<T> type)
        Get a list of devices that implement a certain interface.
        Type Parameters:
        T -
        Parameters:
        type -
        Returns:
      • getW1Devices

        public <T extends W1DeviceList<T> getW1Devices​(Class<T> type)