Class SGrContactsDevice

  • All Implemented Interfaces:
    GenDeviceApi

    public class SGrContactsDevice
    extends SGrDeviceBase<com.smartgridready.ns.v0.DeviceFrame,​com.smartgridready.ns.v0.ContactFunctionalProfile,​com.smartgridready.ns.v0.DataPointBase>
    • Constructor Detail

      • SGrContactsDevice

        public SGrContactsDevice​(com.smartgridready.ns.v0.DeviceFrame deviceDescription,
                                 com.smartgridready.driver.api.contacts.GenDriverAPI4ContactsFactory aDriverFactory)
    • Method Detail

      • getVal

        public Value getVal​(java.lang.String profileName,
                            java.lang.String dataPointName)
                     throws com.smartgridready.driver.api.common.GenDriverException
        Description copied from interface: GenDeviceApi
        Get a value for a given data point
        Parameters:
        profileName - The functional profile name
        dataPointName - The data point name
        Returns:
        The value read from the device
        Throws:
        com.smartgridready.driver.api.common.GenDriverException - Generic error while reading from the device
      • getVal

        public Value getVal​(java.lang.String profileName,
                            java.lang.String dataPointName,
                            java.util.Properties parameters)
                     throws com.smartgridready.driver.api.common.GenDriverException
        Description copied from interface: GenDeviceApi
        Get a value for a given data point, with request-specific parameters
        Parameters:
        profileName - The functional profile name
        dataPointName - The data point name
        parameters - Key value pairs with request parameters
        Returns:
        The value read from the device
        Throws:
        com.smartgridready.driver.api.common.GenDriverException - Generic error while reading from the device
      • setVal

        public void setVal​(java.lang.String profileName,
                           java.lang.String dataPointName,
                           Value value)
                    throws com.smartgridready.driver.api.common.GenDriverException
        Description copied from interface: GenDeviceApi
        Set a value for a given data point
        Parameters:
        profileName - The functional profile name
        dataPointName - The data point name
        value - The value to be set
        Throws:
        com.smartgridready.driver.api.common.GenDriverException - Generic error while reading from the device
      • connect

        public void connect()
                     throws com.smartgridready.driver.api.common.GenDriverException
        Description copied from interface: GenDeviceApi
        Connect the device.
        Throws:
        com.smartgridready.driver.api.common.GenDriverException - Generic error while reading from the device
      • disconnect

        public void disconnect()
                        throws com.smartgridready.driver.api.common.GenDriverException
        Description copied from interface: GenDeviceApi
        Disconnect the device.
        Throws:
        com.smartgridready.driver.api.common.GenDriverException - Generic error while reading from the device
      • isConnected

        public boolean isConnected()
        Description copied from interface: GenDeviceApi
        Checks if the device is connected.
        Returns:
        true if connected, false otherwise
      • findProfile

        protected java.util.Optional<com.smartgridready.ns.v0.ContactFunctionalProfile> findProfile​(java.lang.String profileName)
        Specified by:
        findProfile in class SGrDeviceBase<com.smartgridready.ns.v0.DeviceFrame,​com.smartgridready.ns.v0.ContactFunctionalProfile,​com.smartgridready.ns.v0.DataPointBase>
      • findDataPointForProfile

        protected java.util.Optional<com.smartgridready.ns.v0.DataPointBase> findDataPointForProfile​(com.smartgridready.ns.v0.ContactFunctionalProfile functionalProfile,
                                                                                                     java.lang.String dataPointName)
        Specified by:
        findDataPointForProfile in class SGrDeviceBase<com.smartgridready.ns.v0.DeviceFrame,​com.smartgridready.ns.v0.ContactFunctionalProfile,​com.smartgridready.ns.v0.DataPointBase>