BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

work with hex...

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder JavaAPI
View previous topic :: View next topic  
Author Message
Eliot
Guest





PostPosted: Fri Oct 03, 2003 5:42 am    Post subject: work with hex... Reply with 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


Back to top
Owen Green
Guest





PostPosted: Fri Oct 03, 2003 11:07 am    Post subject: Re: work with hex... Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder JavaAPI All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.