🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.api
2 messages
2 total messages Started by Eliot Fri, 03 Oct 2003 05:42
work with hex...
#354
Author: Eliot
Date: Fri, 03 Oct 2003 05:42
5 lines
1306 bytes
Hi...i need to sena and Hex data ..for example this "0x58 0x31 0x0D 0x0A"
but i dont know how define the variable and how to do to send this to the
serial port
can somebody tell me hoe to do that???
if u can make an example i would be thank
Re: work with hex...
#355
Author: Owen Green
Date: Fri, 03 Oct 2003 11:07
24 lines
1609 bytes
On Fri, 3 Oct 2003 01:42:49 -0400, Eliot wrote:

> Hi...i need to sena and Hex data ..for example this "0x58 0x31 0x0D 0x0A"
> but i dont know how define the variable and how to do to send this to the
> serial port
> can somebody tell me hoe to do that???
> if u can make an example i would be thank

Any numeric primitive is 'hex', so I'm not sure what you mean here. 

You could simply do 

byte myByte = 0xFF;

To send things to the serial port, you need to look at the JavaComm API 
http://java.sun.com/products/javacomm/

This uses OuputStreams for writing, which are geared around writing streams
of bytes, which you can represent in hex. 


hth
--
Owen
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads