|
-
Serial Port Communication
everyone (I'm new to the forum)
I've written a program to retreive data from a badge system via serial port.
The problem is that the data I receive is in some sort of code, I believe it is ANSI but I'm not sure.
Here's the input I get:
]À&DUÃ
Normally this code must contain at least the following (human readable):
28633 (this is the id of my badge)
Here's my code for input:
-------------------------------------------------------------------------
StringBuffer inputBuffer = new StringBuffer();
int newData = 0;
while (input.available() > 0)
{
newData = input.read();
if (newData == -1)
{
break;
}
if ('\r' == (char)newData)
{
inputBuffer.append('\n');
}
else
{
inputBuffer.append((char)newData);
}
System.out.println(new String(inputBuffer));
-------------------------------------------------------------------------
Does anyone know how I can handle this?
thx in advance
Similar Threads
-
Replies: 1
Last Post: 02-21-2006, 01:23 AM
-
By newbie29 in forum Java
Replies: 0
Last Post: 05-16-2005, 04:55 PM
-
Replies: 2
Last Post: 01-14-2002, 12:37 PM
-
Replies: 0
Last Post: 01-14-2002, 11:59 AM
-
Replies: 0
Last Post: 01-14-2002, 06:57 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks