Class SGrContactsDevice
- java.lang.Object
-
- com.smartgridready.communicator.common.impl.SGrDeviceBase<com.smartgridready.ns.v0.DeviceFrame,com.smartgridready.ns.v0.ContactFunctionalProfile,com.smartgridready.ns.v0.DataPointBase>
-
- com.smartgridready.communicator.contacts.impl.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>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.smartgridready.communicator.common.impl.SGrDeviceBase
SGrDeviceBase.Comparator, SGrDeviceBase.RwpDirections
-
-
Field Summary
-
Fields inherited from class com.smartgridready.communicator.common.impl.SGrDeviceBase
device
-
-
Constructor Summary
Constructors Constructor Description SGrContactsDevice(com.smartgridready.ns.v0.DeviceFrame deviceDescription, com.smartgridready.driver.api.contacts.GenDriverAPI4ContactsFactory aDriverFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect()
Connect the device.void
disconnect()
Disconnect the device.protected java.util.Optional<com.smartgridready.ns.v0.DataPointBase>
findDataPointForProfile(com.smartgridready.ns.v0.ContactFunctionalProfile functionalProfile, java.lang.String dataPointName)
protected java.util.Optional<com.smartgridready.ns.v0.ContactFunctionalProfile>
findProfile(java.lang.String profileName)
Value
getVal(java.lang.String profileName, java.lang.String dataPointName)
Get a value for a given data pointValue
getVal(java.lang.String profileName, java.lang.String dataPointName, java.util.Properties parameters)
Get a value for a given data point, with request-specific parametersboolean
isConnected()
Checks if the device is connected.void
setVal(java.lang.String profileName, java.lang.String dataPointName, Value value)
Set a value for a given data point-
Methods inherited from class com.smartgridready.communicator.common.impl.SGrDeviceBase
applyUnitConversion, canSubscribe, checkOutOfRange, checkOutOfRange, checkReadWritePermission, divide, findDataPoint, getDataPoint, getDataPoints, getDeviceConfigurationInfo, getDeviceInfo, getFunctionalProfile, getFunctionalProfiles, getValues, isNumeric, multiply, subscribe, unsubscribe
-
-
-
-
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 namedataPointName
- 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 namedataPointName
- The data point nameparameters
- 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 namedataPointName
- The data point namevalue
- 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 classSGrDeviceBase<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 classSGrDeviceBase<com.smartgridready.ns.v0.DeviceFrame,com.smartgridready.ns.v0.ContactFunctionalProfile,com.smartgridready.ns.v0.DataPointBase>
-
-