Jump to content


Check out our Community Blogs

icandoit

Member Since 21 Aug 2012
Offline Last Active Aug 29 2013 12:47 AM
-----

Posts I've Made

In Topic: time in and out in html

16 October 2012 - 08:15 AM

nope sir I just want to know if how can I compute the wages of an employee according to the time that they spent in a half month...

In Topic: Arduino

29 September 2012 - 11:16 PM

is there a battery that can lasts for week?

In Topic: Scan RFID and add to database

17 September 2012 - 06:17 PM

I want to see all the numbers in or serial numbers in a particular tag but java read it 1 by 1 like 9................7.............then back to 9............then back to 7.......It doesn't complete all the serial numbers registered in a tag..

In Topic: Scan RFID and add to database

14 September 2012 - 05:50 AM

can anyone help me?
what's wrong with this code...

import java.io.*;
import java.util.*;
import javax.comm.*;

public class InputOutput implements Runnable, SerialPortEventListener {
	static CommPortIdentifier portId;
	static Enumeration	   portList;
	InputStream	   inputStream;
	SerialPort	   serialPort;
	Thread	   readThread;


	public static void main(String[] args) {
	boolean	   portFound = false;
	String	   defaultPort = "COM4";

  if (args.length > 0) {
   defaultPort = args[0];
}

portList = CommPortIdentifier.getPortIdentifiers();

while (portList.hasMoreElements()) {
   portId = (CommPortIdentifier) portList.nextElement();
   if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals(defaultPort)) {
   System.out.println("Found port: "+defaultPort);
   portFound = true;
   InputOutput reader = new InputOutput();
}
   }
}
if (!portFound) {
   System.out.println("port " + defaultPort + " not found.");
}
  
	}


	public InputOutput() {
try {
   serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
} catch (PortInUseException e) {}

try {
   inputStream = serialPort.getInputStream();
} catch (IOException e) {}

try {
   serialPort.addEventListener(this);
} catch (TooManyListenersException e) {}

serialPort.notifyondataavailable(true);

try {
   serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
  SerialPort.STOPBITS_1,
  SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {}

readThread = new Thread(this);

readThread.start();
	}


	public void run() {
try {
   Thread.sleep(20000);
} catch (InterruptedException e) {}
	}


	public void serialEvent(SerialPortEvent event) {
switch (event.getEventType()) {

case SerialPortEvent.BI:

case SerialPortEvent.OE:

case SerialPortEvent.FE:

case SerialPortEvent.PE:

case SerialPortEvent.CD:

case SerialPortEvent.CTS:

case SerialPortEvent.DSR:

case SerialPortEvent.RI:

case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
   break;

case SerialPortEvent.DATA_AVAILABLE:
   byte[] readBuffer = new byte[20];

   try {
while (inputStream.available() > 0)
{
   int numBytes = inputStream.read(readBuffer);
   System.out.print("The Read Bytes from SerialPort are");
   System.out.write(readBuffer);
   System.out.println();
}

System.out.print(new String(readBuffer));
   } catch (IOException e) {}

   break;
}
	}

}

Every time I Face the magnetic card on the red copper in RFID the characters are not fully displayed...

In Topic: Biometrics using c

10 September 2012 - 12:03 AM

sorry but to be honest I don't have any idea how to do this...
:(

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download