 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Eliot Guest
|
Posted: Fri Oct 03, 2003 5:42 am Post subject: work with hex... |
|
|
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
|
|
| Back to top |
|
 |
Owen Green Guest
|
Posted: Fri Oct 03, 2003 11:07 am Post subject: Re: work with hex... |
|
|
On Fri, 3 Oct 2003 01:42:49 -0400, Eliot wrote:
| Quote: | 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
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|