public class LogicalDevice
extends java.lang.Object
Constructor and Description |
---|
LogicalDevice(int logicalDeviceId,
java.lang.String logicalDeviceName,
java.lang.String manufacturerId,
long deviceId)
Creates a new Logical Device.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addRestriction(int clientId,
SecuritySuite securitySuite)
Adds a restriction to the Logical Device.
|
org.openmuc.jdlms.internal.asn1.cosem.Conformance |
getConformance() |
int |
getLogicalDeviceId() |
java.lang.String |
getLogicalDeviceName() |
java.lang.String |
getManufacturerId() |
byte[] |
getMasterKey() |
java.util.Map<java.lang.Integer,SecuritySuite> |
getRestrictions() |
byte[] |
getSystemTitle() |
LogicalDevice |
registerCosemObject(CosemInterfaceObject... cosemObject)
Register a new COSEM class.
|
LogicalDevice |
registerCosemObject(java.util.List<CosemInterfaceObject> cosemObject)
Register a new COSEM class.
|
LogicalDevice |
setConformance(LnConformanceSetting... conformanceSetting)
Sets the logical device conformance.
|
LogicalDevice |
setMasterKey(byte[] masterKey)
Sets the master key.
|
public LogicalDevice(int logicalDeviceId, java.lang.String logicalDeviceName, java.lang.String manufacturerId, long deviceId)
logicalDeviceId
- logical device id. Id to identify the logical device. Integer greater than 0.logicalDeviceName
- The logical device name is defined as an octet-string of up to 16 octets/characters. The first three
octets/characters shall carry the manufacturer identifier. The manufacturer shall ensure that the
logical device name, starting with the three octets/characters identifying the manufacturer and
followed by up to 13 octets/characters, is unique.manufacturerId
- unique String ID of three characters.
deviceId
- 5 byte device ID.java.lang.IllegalArgumentException
- if a parameter does not fulfill its requirements.public java.lang.String getLogicalDeviceName()
public java.lang.String getManufacturerId()
public int getLogicalDeviceId()
public byte[] getMasterKey()
public LogicalDevice setMasterKey(byte[] masterKey)
NOTE: The master key must be 128 bits long.
masterKey
- the master key.java.lang.IllegalArgumentException
- if the key length is not supported.public boolean addRestriction(int clientId, SecuritySuite securitySuite)
NOTE: The master key must be set if a key is used in the authentication.
clientId
- the client ID. Value greater than zero.securitySuite
- a new restriction/security suite for the logical device.true
if the clientId was not set so far, false
otherwise.java.lang.IllegalArgumentException
- if the arguments don't fulfill their requirements.setMasterKey(byte[])
public LogicalDevice registerCosemObject(CosemInterfaceObject... cosemObject)
cosemObject
- a class annotated with CosemClass
.CosemClass
public LogicalDevice registerCosemObject(java.util.List<CosemInterfaceObject> cosemObject)
cosemObject
- a class annotated with CosemClass
.public java.util.Map<java.lang.Integer,SecuritySuite> getRestrictions()
public org.openmuc.jdlms.internal.asn1.cosem.Conformance getConformance()
public byte[] getSystemTitle()
public LogicalDevice setConformance(LnConformanceSetting... conformanceSetting)
conformanceSetting
- set the conformance settings.