Skip to content

Commit

Permalink
Fix all javadoc warnings (#106)
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Pietryga <[email protected]>
  • Loading branch information
tresf and pietrygamat authored Aug 5, 2021
1 parent 8a7148b commit 7c2e3ff
Show file tree
Hide file tree
Showing 9 changed files with 429 additions and 123 deletions.
2 changes: 1 addition & 1 deletion src/main/cpp/_nix_based/jssc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ JNIEXPORT jint JNICALL Java_jssc_SerialNativeInterface_getFlowControlMode

/* OK */
/*
* Send break for setted duration
* Send break for set duration
*/
JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_sendBreak
(JNIEnv *, jobject, jlong portHandle, jint duration){
Expand Down
4 changes: 2 additions & 2 deletions src/main/cpp/windows/jssc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_setParams

if(SetCommState(hComm, dcb)){

//since 2.1.0 -> previously setted timeouts by another application should be cleared
//since 2.1.0 -> timeouts set previously by another application should be cleared
COMMTIMEOUTS *lpCommTimeouts = new COMMTIMEOUTS();
lpCommTimeouts->ReadIntervalTimeout = 0;
lpCommTimeouts->ReadTotalTimeoutConstant = 0;
Expand Down Expand Up @@ -392,7 +392,7 @@ JNIEXPORT jint JNICALL Java_jssc_SerialNativeInterface_getFlowControlMode
}

/*
* Send break for setted duration
* Send break for set duration
*
* since 0.8
*/
Expand Down
63 changes: 53 additions & 10 deletions src/main/java/jssc/SerialNativeInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,43 +37,71 @@ public class SerialNativeInterface {
private static final String libVersion = "2.9";
private static final String libMinorSuffix = "1"; //since 0.9.0

/** Linux **/
public static final int OS_LINUX = 0;
/** Windows **/
public static final int OS_WINDOWS = 1;
/** Solaris **/
public static final int OS_SOLARIS = 2;//since 0.9.0
/** MacOS **/
public static final int OS_MAC_OS_X = 3;//since 0.9.0

private static int osType = -1;
/** Unknown **/
public static final int OS_UNKNOWN = -1;//since 0.9.0

/**
* Port is busy
*
* @since 2.3.0
*/
public static final long ERR_PORT_BUSY = -1;
/**
* Port is not found
*
* @since 2.3.0
*/
public static final long ERR_PORT_NOT_FOUND = -2;
/**
* Insufficient permissions to access port
*
* @since 2.3.0
*/
public static final long ERR_PERMISSION_DENIED = -3;
/**
* Serial port handle is incorrect
*
* @since 2.3.0
*/
public static final long ERR_INCORRECT_SERIAL_PORT = -4;

/**
* Disable exclusive lock for serial port
*
* Usage:
* <code>System.setProperty("jssc_no_tiocexcl", "true");</code>
*
* @since 2.6.0
*/
public static final String PROPERTY_JSSC_NO_TIOCEXCL = "JSSC_NO_TIOCEXCL";
/**
* Ignore bytes with framing error or parity error
*
* Usage:
* <code>System.setProperty("jssc_ignpar", "true");</code>
*
* @since 2.6.0
*/
public static final String PROPERTY_JSSC_IGNPAR = "JSSC_IGNPAR";
/**
* Mark bytes with parity error or framing error
*
* Usage:
* <code>System.setProperty("jssc_iparmrk", "true");</code>
*
* @since 2.6.0
*/
public static final String PROPERTY_JSSC_PARMRK = "JSSC_PARMRK";

private static int osType;
static {
String osName = System.getProperty("os.name");
if(osName.equals("Linux"))
Expand All @@ -84,6 +112,8 @@ else if(osName.equals("SunOS"))
osType = OS_SOLARIS;
else if(osName.equals("Mac OS X") || osName.equals("Darwin"))
osType = OS_MAC_OS_X;
else
osType = OS_UNKNOWN;
try {
/**
* JSSC includes a small, platform-specific shared library and uses native-lib-loader for extraction.
Expand All @@ -105,7 +135,10 @@ else if(osName.equals("Mac OS X") || osName.equals("Darwin"))
public SerialNativeInterface() {}

/**
* Get OS type (OS_LINUX || OS_WINDOWS || OS_SOLARIS)
* Get OS type
*
* @return <code>OS_LINUX</code>, <code>OS_WINDOWS</code>, <code>OS_SOLARIS</code>,<code>OS_MACOS</code>
* or <code>OS_UNKNOWN</code> if unknown.
*
* @since 0.8
*/
Expand All @@ -114,7 +147,9 @@ public static int getOsType() {
}

/**
* Get jSSC version. The version of library is <b>Base Version</b> + <b>Minor Suffix</b>
* Get library version
*
* @return Full library version in "major.minor.patch" format.
*
* @since 0.8
*/
Expand All @@ -123,27 +158,35 @@ public static String getLibraryVersion() {
}

/**
* Get jSSC Base Version
* Get library base Version
*
* @return Library base version in "major.minor" format. Was previously used for library versioning caching
* but is no longer used by the project.
*
* @since 0.9.0
*/
@Deprecated
public static String getLibraryBaseVersion() {
return libVersion;
}

/**
* Get jSSC minor suffix. For example in version 0.8.1 - <b>1</b> is a minor suffix
* Get library patch version
*
* @return Library patch version only (e.g. only "patch" from "major.minor.patch"). Was previously used for
* library versioning caching but is no longer used by the project.
*
* @since 0.9.0
*/
@Deprecated
public static String getLibraryMinorSuffix() {
return libMinorSuffix;
}

/**
* Get jSSC native library version
* Get native library version
*
* @return native lib version (for jSSC-2.8.0 should be 2.8 for example)
* @return Full native library version in "major.minor.patch" format.
*
* @since 2.8.0
*/
Expand Down Expand Up @@ -293,7 +336,7 @@ public static String getLibraryMinorSuffix() {
*
* @param handle handle of opened port
*
* @return Mask of setted flow control mode
* @return Mask of set flow control mode
*
* @since 0.8
*/
Expand All @@ -320,7 +363,7 @@ public static String getLibraryMinorSuffix() {
public native int[] getLinesStatus(long handle);

/**
* Send Break singnal for setted duration
* Send Break signal for set duration
*
* @param handle handle of opened port
* @param duration duration of Break signal
Expand Down
Loading

0 comments on commit 7c2e3ff

Please sign in to comment.