![JAR search and dependency download from the Maven repository](/logo.png)
com.embeddedunveiled.serial.vendor.FTOpenedDeviceInfo 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 an opened FT device with information about it.
*
* @author Rishi Gupta
*/
public final class FTOpenedDeviceInfo {
private String type = null;
private String id = null;
private String serialNumber = null;
private String description = null;
/**
* Construct and allocates a new FTOpenedDeviceInfo object with given details.
*
* @param type device type.
* @param id device ID.
* @param serialNumber serial number of this device.
* @param description description of this device.
*/
public FTOpenedDeviceInfo(String type, String id, String serialNumber, String description) {
this.type = type;
this.id = id;
this.serialNumber = serialNumber;
this.description = description;
}
/**
* Retrieves the type for this opened FT device.
*
* @return type for this FT device info node.
* @throws NumberFormatException if the type hex string can not be converted into numerical representation.
*/
public long getType() {
return SerialComUtil.hexStrToLongNumber(type);
}
/**
* Retrieves the id for this opened FT device.
*
* @return id for this FT device info node.
* @throws NumberFormatException if the id hex string can not be converted into numerical representation.
*/
public long getId() {
return SerialComUtil.hexStrToLongNumber(id);
}
/**
* Retrieves the serial number string for this opened FT device.
*
* @return serial number string for this FT device info node.
*/
public String getSerialNumber() {
return serialNumber;
}
/**
* Retrieves the description for this opened FT device.
*
* @return description string for this FT device info node.
*/
public String getDescription() {
return description;
}
/**
* Prints information about this opened FT device on console.
*/
public void dumpDeviceInfo() {
System.out.println("\nType : " + type +
"\nID : 0x" + id +
"\nSerialNumber : " + serialNumber +
"\nDescription : " + description);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy