public final class SerialComPortMapper extends Object
Provides methods to create and remove alias for serial ports is system.
| Constructor and Description |
|---|
SerialComPortMapper(SerialComPortMapperJNIBridge mSerialComPortMapperJNIBridge)
Construct and allocates a new SerialComPortMapper object with given details.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
listCreatedAliases()
Provides caller with a read-only Map view of the aliases created using SCM library.
|
boolean |
mapAliasToExistingComPort(String alias,
String comPort)
Creates a alias to the given existing serial port.
|
boolean |
startMappingService()
Start the service which may run with elevated privileges in system.
|
boolean |
stopMappingService()
Stops the serial port mapping service when no more required.
|
boolean |
unmapAliasToExistingComPort(String alias)
Removes a previously created alias to the given existing serial port.
|
public SerialComPortMapper(SerialComPortMapperJNIBridge mSerialComPortMapperJNIBridge)
Construct and allocates a new SerialComPortMapper object with given details.
mSerialComPortMapperJNIBridge - interface class to native library for calling platform
specific routines.SerialComException - if the object can not be constructed.public boolean startMappingService()
throws SerialComException
Start the service which may run with elevated privileges in system.
SerialComException - if an error occurs.public boolean stopMappingService()
throws SerialComException
Stops the serial port mapping service when no more required. This increase the security if this library is running on servers.
SerialComException - if an error occurs.public boolean mapAliasToExistingComPort(String alias, String comPort) throws SerialComException
Creates a alias to the given existing serial port.
alias - created name that maps to existing serial port.comPort - actual existing serial port which is mapped.SerialComException - if alias can not be created or an I/O error occurs.public boolean unmapAliasToExistingComPort(String alias) throws SerialComException
Removes a previously created alias to the given existing serial port.
alias - created name that maps to existing serial port.SerialComException - if given alias is unknown to this library, or if given
alias can not be removed or an I/O error occurs.Copyright © 2016. All rights reserved.