package NTPortJava; /* NTPort Library Copyright (c) 1997-2006 Hai Li, Zeal SoftStudio. E-Mail: support@zealsoft.com Web: http://www.zealsoft.com */ public class NTPortJava { // Returns a value indicating the last operation is successful or not. public native static int GetLastState(StringBuffer s); // Enable your application to read or write specific ports. public native static void EnablePorts(short PortStart, short PortStop); // Disable your application to read or write specific ports. public native static void DisablePorts(short PortStart, short PortStop); // Returns a value indicates whether the application is running under Windows NT/2000 system. public native static boolean IsWinNT(); // Returns a value indicates whether the application is running under 64-bit Windows system. public native static boolean IsWin64(); // Returns a value from specific ports. public native static short Inp(short PortNum); public native static short Inport(short PortNum); public native static short Inpw(short PortNum); public native static short InportW(short PortNum); public native static int Inpd(short PortNum); public native static int InportD(short PortNum); // Write a value to specific ports. public native static void Outp(short PortNum, short Data); public native static void Outport(short PortNum, short Data); public native static void Outpw(short PortNum, short Data); public native static void OutportW(short PortNum, short Data); public native static void Outpd(short PortNum, int Data); public native static void OutportD(short PortNum, int Data); // Set the registration information. public native static void LicenseInfo(String sUserName, int sKey); // Returns the version of NTPort Library. public native static short GetNTPortVersion(); // Set the setting of fast mode public native static void SetFastMode(boolean bOption); // Get the current setting of fast mode public native static boolean GetFastMode(); // Get the base address of LPT port public native static short GetLPTPortAddress(short PortNo); // Get the high resolution time public native static double GetHiResTime(); public static final int ERROR_NONE = 0; public static final int ERROR_DRIVER = 2; public static final int ERROR_SCM_CANT_CONNECT = 9998; static { System.loadLibrary( "NTPortJava" ); } }