![JAR search and dependency download from the Maven repository](/logo.png)
com.embeddedunveiled.serial.vendor.FTdeviceInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scm Show documentation
Show all versions of scm Show documentation
serial communication in java
The newest version!
/*
* Author : Rishi Gupta
*
* This file is part of 'serial communication manager' library.
* Copyright (C) <2014-2016>
*
* This 'serial communication manager' is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* The 'serial communication manager' is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with 'serial communication manager'. If not, see .
*/
package com.embeddedunveiled.serial.vendor;
import com.embeddedunveiled.serial.util.SerialComUtil;
/**
* Represents a device returned by calling listDevices() method in
* SerialComFTDID2XX class.
*
* @author Rishi Gupta
*/
public final class FTdeviceInfo {
private String locId = null;
private String serialNumber = null;
private String description = null;
/**
* Construct and allocates a new FTdeviceInfo object with given details.
*
* @param locId location ID of the device.
* @param serialNumber serial number of this device.
* @param description description of this device.
*/
public FTdeviceInfo(String locId, String serialNumber, String description) {
this.locId = locId;
this.serialNumber = serialNumber;
this.description = description;
}
/**
* Retrieves the locId for this FT device.
*
* @return locId for this FT device.
* @throws NumberFormatException if the locId hex string can not be converted into numerical
* representation.
*/
public long getLocId() {
return SerialComUtil.hexStrToLongNumber(locId);
}
/**
* Retrieves the serial number string for this FT device.
*
* @return serial number string for this FT device.
*/
public String getSerialNumber() {
return serialNumber;
}
/**
* Retrieves the description for this FT device.
*
* @return description string for this FT device.
*/
public String getDescription() {
return description;
}
/**
* Prints information about this FT device on console.
*/
public void dumpDeviceInfo() {
System.out.println("LocID : 0x" + locId +
"\nSerialNumber : " + serialNumber +
"\nDescription : " + description);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy